[Pomoc] /bbank

Započeo ▂ ▃ ▅ Rudimental ▅ ▃ ▂, Maj 17, 2012, 19:39:39 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Scripta koju koristim: moja
Deo problema: napravio sam /bbank i sad to svugde radi kako da napravim da radi tamo gde ja hocu ?
Deo scripte:
if(strcmp(cmd, "/bbank", true) == 0 || strcmp(cmd, "/bdeposit", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
            if(PlayerInfo[playerid][pLocal] == 103 || PlayerToPoint(1.5, playerid, 1294.7236,-1368.4146,13.6174))
         {
               SendClientMessage(playerid, COLOR_GREY, "  Niste kod bankomata");
               return 1;
           }
         tmp = strtok(cmdtext, idx);
         if(!strlen(tmp))
         {
            SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /bbank [suma]");
            format(string, sizeof(string), "  Imate $%d na vasem racunu.", PlayerInfo[playerid][pAccount]);
            SendClientMessage(playerid, COLOR_GRAD3, string);
            return 1;
         }
         new cashdeposit = strval(tmp);
         if(!strlen(tmp))
         {
            SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /bbank [amount]");
            format(string, sizeof(string), "  You Have $%d in your account.", PlayerInfo[playerid][pAccount]);
            SendClientMessage(playerid, COLOR_GRAD3, string);
            return 1;
         }
         if (cashdeposit > GetPlayerMoney(playerid) || cashdeposit < 1)
         {
            SendClientMessage(playerid, COLOR_GRAD2, "   You dont have that much");
            return 1;
         }
         SafeGivePlayerMoney(playerid,-cashdeposit);
         new curfunds = PlayerInfo[playerid][pAccount];
         PlayerInfo[playerid][pAccount]=cashdeposit+PlayerInfo[playerid][pAccount];
         SendClientMessage(playerid, COLOR_WHITE, "|___ Bankarski Izvestaj ___|");
         format(string, sizeof(string), "  Staro stanje: $%d", curfunds);
         SendClientMessage(playerid, COLOR_GRAD2, string);
         format(string, sizeof(string), "  Prilozeno: $%d",cashdeposit);
         SendClientMessage(playerid, COLOR_GRAD4, string);
         SendClientMessage(playerid, COLOR_GRAD6, "|-----------------------------------------|");
         format(string, sizeof(string), "  Novo stanje: $%d", PlayerInfo[playerid][pAccount]);
         SendClientMessage(playerid, COLOR_WHITE, string);
         return 1;
      }
      return 1;
   }

 if(PlayerInfo[playerid][pLocal] == 103 || PlayerToPoint(1.5, playerid, 1294.7236,-1368.4146,13.6174))  <-----------------------------Izbrisi  PlayerInfo[playerid][pLocal] == 103 ||  i ostace ti kordinata na kojoj mozes da kucas komandu :D

E hvala brt namestio sam to nego sad imam jos 1 problem hocu da namestim da sa 1 komandom rade svi bankomati al kad ja napravim 2 ili vise kordinata pise mi da nisam kod bankomata kako to da resim ?

if(!IsPlayerInRangeOfPoint(playerid, 3,1590.0690,-2334.6016,13.5397) || !IsPlayerInRangeOfPoint(playerid, 3,1500.0322,-1743.0776,13.5469))
         {
             SendClientMessage(playerid, COLOR_GRAD1, "Niste kod bankomata!");
             return 1;

Snich

Na vrh skripte dodas forward:

forward IsAtBankomat(playerid);

Zatim dodajes public na kraj skripte:

public IsAtBankomat(playerid)
{
    if(IsPlayerConnected(playerid))
   {
if(PlayerToPoint(2.0,playerid, 1294.7236,-1368.4146,13.6174))
        {
      return 1;
}
else if(PlayerToPoint(2.0,playerid, 1500.0322,-1743.0776,13.5469))
{
      return 1;
}
}
return 0;
}


Nakon toga u komandu /bbank jednostavno dodas provjeru:

if(!IsAtBankomat(playerid))
{
     SendClientMessage(playerid, COLOR_GREY, "Morate biti ispred bankomata!");
     return 1;
}
Poslednja Izmena: Maj 17, 2012, 23:21:20 POSLE PODNE od [FG] Snich

brt mnogo ti hvala moze LOCK.

Snich