[Pomoc]Oglas

Započeo :::... Master ...:::, Maj 26, 2012, 07:56:16 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: Moja iz 0
Detaljan opis problema: Pa sad napravio sam da se /ad pusta na vise mesta i kad udzem na server pisem neku drugu CMD ono mi izlazi niste u oglasnik, kako svaka komanda da je povrzana s tu komandu
Dio skripte: Evo komanda

if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if (!PlayerToPoint(5, playerid, -2240.468505,137.060440,1035.414062))
        {
                SendClientMessage(playerid, COLOR_GREY, "Neste vo oglasnik!");
            return 1;
        }
        if(gPlayerLogged[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "   Seuste ne ste logirani !");
            return 1;
        }
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: (/ad)vertise [advert text]");
return 1;
}
if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
{
format(string, sizeof(string), "   Ve molime probajte podocna %d sekundi pomegu oglasot !",  (addtimer/1000));
SendClientMessage(playerid, COLOR_GRAD2, string);
return 1;

}
new payout = idx * 25;
if(GetPlayerMoney(playerid) < payout)
        {
            format(string, sizeof(string), "* Iskoristivte %d Bukvi koj cinat $%d, Nemate dovolno.", offset, payout);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
            return 1;
        }
GivePlayerMoney(playerid, - payout);
SBizzInfo[7][sbTill] += payout;
ExtortionSBiz(7, payout);
format(string, sizeof(string), "[OGLAS]: %s | Kontakt: %s Mobilen: %d",  result, sendername,PlayerInfo[playerid][pPnumber]);
OOCNews(TEAM_GROVE_COLOR,string);
format(string, sizeof(string), "~r~Plativte $%d~n~~w~Poraka se sostoi od: %d Bukvi", payout, idx);
GameTextForPlayer(playerid, string, 5000, 5);
if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0; return 1; }
}
    if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
{
format(string, sizeof(string), "   Ve molime probajte podocna %d sekundi pomegu oglasot !",  (addtimer/1000));
SendClientMessage(playerid, COLOR_GRAD2, string);
return 1;

}
    if (!PlayerToPoint(5, playerid, 663.836242,-575.605407,16.343263))
        {
                SendClientMessage(playerid, COLOR_GREY, "Neste vo oglasnik!");
            return 1;
        }
        new payout1 = idx * 25;
        new offset1 = idx;
if(GetPlayerMoney(playerid) < payout1)
        {
            format(string, sizeof(string), "* Iskoristivte %d Bukvi koj cinat $%d, Nemate dovolno.", offset1, payout1);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
            return 1;
        }
        new result1[64];
GivePlayerMoney(playerid, - payout1);
SBizzInfo[7][sbTill] += payout1;
ExtortionSBiz(7, payout1);
format(string, sizeof(string), "[OGLAS]: %s | Kontakt: %s Mobilen: %d",  result1, sendername,PlayerInfo[playerid][pPnumber]);
OOCNews(TEAM_GROVE_COLOR,string);
format(string, sizeof(string), "~r~Plativte $%d~n~~w~Poraka se sostoi od: %d Bukvi", payout1, idx);
GameTextForPlayer(playerid, string, 5000, 5);
if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0; return 1; }
         }
    if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
{
format(string, sizeof(string), "   Ve molime probajte podocna %d sekundi pomegu oglasot !",  (addtimer/1000));
SendClientMessage(playerid, COLOR_GRAD2, string);
return 1;

}
    if (!PlayerToPoint(5, playerid, -103.559165,-24.225606,1000.718750))
        {
                SendClientMessage(playerid, COLOR_GREY, "Neste vo oglasnik!");
            return 1;
        }
        new payout2 = idx * 25;
        new offset2 = idx;
if(GetPlayerMoney(playerid) < payout2)
        {
            format(string, sizeof(string), "* Iskoristivte %d Bukvi koj cinat $%d, Nemate dovolno.", offset2, payout2);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
            return 1;
        }
        new result2[64];
GivePlayerMoney(playerid, - payout2);
SBizzInfo[7][sbTill] += payout2;
ExtortionSBiz(7, payout2);
format(string, sizeof(string), "[OGLAS]: %s | Kontakt: %s Mobilen: %d",  result2, sendername,PlayerInfo[playerid][pPnumber]);
OOCNews(TEAM_GROVE_COLOR,string);
format(string, sizeof(string), "~r~Plativte $%d~n~~w~Poraka se sostoi od: %d Bukvi", payout2, idx);
GameTextForPlayer(playerid, string, 5000, 5);
if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;
    return 1;
}

Ubaci ovu komandu!!!
promeni kordinate gde zelis da ti bude advert

Citatif(strcmp(cmd, "/advert", true) == 0 || strcmp(cmd, "/ad", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
           if(gPlayerLogged[playerid] == 0)
           {
               SendClientMessage(playerid, COLOR_GREY, "Niste se ulogovali!");
               return 1;
           }
           if(PlayerInfo[playerid][pLevel] < 2)
           {
               SendClientMessage(playerid, COLOR_GREY, "Morate biti lvl 2 da koristite ovu komandu!");
               return 1;
           }
          if (PlayerToPoint(3, playerid,255.3,77.4,1003.6) || PlayerToPoint(3,playerid,254.4334,190.6243,1008.1718))// evo tu ti je dodano 2 kordinate a mozes i vise
           {
               SendClientMessage(playerid, COLOR_GREY, "Niste kod ABC studija!");
               return 1;
           }
         GetPlayerName(playerid, sendername, sizeof(sendername));
         new length = strlen(cmdtext);
         while ((idx < length) && (cmdtext[idx] <= ' '))
         {
            idx++;
         }
         new offset = idx;
         new result[64];
         while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
         {
            result[idx - offset] = cmdtext[idx];
            idx++;
         }
         result[idx - offset] = EOS;
         if(!strlen(result))
         {
            SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/ad)vertise [advert text]");
            return 1;
         }
         if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
         {
            format(string, sizeof(string), "Molimo pokusajte jer treba da prodje %d sekundi izmedju reklama !",  (addtimer/1000));
            SendClientMessage(playerid, COLOR_GRAD2, string);
            return 1;

         }
         new payout = idx * 5;
         if(GetPlayerMoney(playerid) < payout)
           {
               format(string, sizeof(string), "* Vi ste iskoristili %d slova sto kosta $%d, nemate dovoljno novca.", offset, payout);
               SendClientMessage(playerid, COLOR_WHITE, string);
               return 1;
           }
         SafeGivePlayerMoney(playerid, - payout);
         SBizzInfo[7][sbTill] += payout;
         ExtortionSBiz(7, payout);
         format(string, sizeof(string), "[Advert] %s, Br: %d, Ime: %s",  result, PlayerInfo[playerid][pPnumber], sendername);
         OOCNews(TEAM_GROVE_COLOR,string);
         format(string, sizeof(string), "~r~Racun $%d~n~~w~Poruka je sadrzala: %d Slova", payout, idx);
         GameTextForPlayer(playerid, string, 5000, 1);
         if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
      }
      return 1;
   }

Citat: [BU]Lukas poslato Maj 26, 2012, 08:37:00 PRE PODNE
Ubaci ovu komandu!!!
promeni kordinate gde zelis da ti bude advert

Citatif(strcmp(cmd, "/advert", true) == 0 || strcmp(cmd, "/ad", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
           if(gPlayerLogged[playerid] == 0)
           {
               SendClientMessage(playerid, COLOR_GREY, "Niste se ulogovali!");
               return 1;
           }
           if(PlayerInfo[playerid][pLevel] < 2)
           {
               SendClientMessage(playerid, COLOR_GREY, "Morate biti lvl 2 da koristite ovu komandu!");
               return 1;
           }
          if (PlayerToPoint(3, playerid,255.3,77.4,1003.6) || PlayerToPoint(3,playerid,254.4334,190.6243,1008.1718))// evo tu ti je dodano 2 kordinate a mozes i vise
           {
               SendClientMessage(playerid, COLOR_GREY, "Niste kod ABC studija!");
               return 1;
           }
         GetPlayerName(playerid, sendername, sizeof(sendername));
         new length = strlen(cmdtext);
         while ((idx < length) && (cmdtext[idx] <= ' '))
         {
            idx++;
         }
         new offset = idx;
         new result[64];
         while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
         {
            result[idx - offset] = cmdtext[idx];
            idx++;
         }
         result[idx - offset] = EOS;
         if(!strlen(result))
         {
            SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/ad)vertise [advert text]");
            return 1;
         }
         if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
         {
            format(string, sizeof(string), "Molimo pokusajte jer treba da prodje %d sekundi izmedju reklama !",  (addtimer/1000));
            SendClientMessage(playerid, COLOR_GRAD2, string);
            return 1;

         }
         new payout = idx * 5;
         if(GetPlayerMoney(playerid) < payout)
           {
               format(string, sizeof(string), "* Vi ste iskoristili %d slova sto kosta $%d, nemate dovoljno novca.", offset, payout);
               SendClientMessage(playerid, COLOR_WHITE, string);
               return 1;
           }
         SafeGivePlayerMoney(playerid, - payout);
         SBizzInfo[7][sbTill] += payout;
         ExtortionSBiz(7, payout);
         format(string, sizeof(string), "[Advert] %s, Br: %d, Ime: %s",  result, PlayerInfo[playerid][pPnumber], sendername);
         OOCNews(TEAM_GROVE_COLOR,string);
         format(string, sizeof(string), "~r~Racun $%d~n~~w~Poruka je sadrzala: %d Slova", payout, idx);
         GameTextForPlayer(playerid, string, 5000, 1);
         if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
      }
      return 1;
   }
Ovo ne radi, ko moze mi pomoci... ?

if (!PlayerToPoint(5, playerid, KORDINATE)) //nadjes ovo na svojoj komandi pa promeni kordinate!!

Ljudi vi mene niste svatili ja zelim da komanda /ad se moze koristiti na 3 mesta ali gde ima u komandu playertopoint stavim vise koordinate i kad pisem /ad komanda se izvrsue samo na ednu koordinatu ?
A ja zelim da ta komanda se izvrsue na 3 mesta....

Pa daj bre procitaj malo pa znam to ama kad postavim tako samo se vrsi komanda /ad samo kod 1 koordinate....
Razumete...?

Ovako stavi:
if (!PlayerToPoint(3, playerid, -2240.468505,137.060440,1035.414062)) && !PlayerToPoint(3,playerid,254.4334,190.6243,1008.1718)) && !PlayerToPoint(3,playerid,254.4334,190.6243,1008.1718))
{
   SendClientMessage(playerid, COLOR_GREY, "Niste kod ABC studija!");
   return 1;
}

Last nick: Paradox