SA-MP Forums Archive
Command not working - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Command not working (/showthread.php?tid=437327)



Command not working - kiloman3 - 15.05.2013

pawn Код:
if(strcmp(cmd, "/robbank", true) == 0)
{
    new Amount[200];
    new loot = random(300000);
    if(IsPlayerInRangeOfPoint(playerid, 10.0, 2240.57,2303.70,2.41) || IsPlayerInRangeOfPoint(playerid, 10.0, -1609.12,89.46,-0.59) || IsPlayerInRangeOfPoint(playerid, 10.0, -831.60,1514.38,12.21) || IsPlayerInRangeOfPoint(playerid, 10, -169.18,1183.21,12.21) || IsPlayerInRangeOfPoint(playerid, 10, 1482.51,-1791.82,9.1))//LS
    {
    if(HasRobbed[playerid] == 0)
    {
    if(GetPlayerWantedLevel(playerid) < 3)
    {
    format(Amount,sizeof(Amount), "You have robbed the bank and receive $%d", loot);
    SendClientMessage(playerid, 0x00FF00FF, Amount);
    GivePlayerMoney(playerid,loot);
    SetPlayerScore(playerid,GetPlayerScore(playerid) + 3);
    HasRobbed[playerid] = 1;
    SetPlayerWantedLevel(playerid,6);
    SetTimer("RobTimer", 15000,0);
    qween = playerid;
    }
    else
    SendClientMessage(playerid,0xFF0000FF, "You must be in a bank to use this conmmnand.");

    }
    else
    SendClientMessage(playerid,0xFF0000FF, "Your wanted level is currently too high.");

    }
    else
    SendClientMessage(playerid,0xFF0000FF, "This Bank Has Already Been Robbed, Come Back Later.");
    return 1;
}
I walk into the lv bank it works but none of the others work when i do the command


Re: Command not working - AIped - 15.05.2013

Try it this way;
pawn Код:
enum BankLocationInfo
{
    Float:BankX,
    Float:BankY,
    Float:BankZ
}
new Float:gBankLocation[][BankLocationInfo] =
{
  {2240.57,2303.70,2.41},
  {-1609.12,89.46,-0.59},
  {-831.60,1514.38,12.21},
  {-169.18,1183.21,12.21},
  {1482.51,-1791.82,9.1}
};
Then in replace your;
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 10.0, 2240.57,2303.70,2.41) || IsPlayerInRangeOfPoint(playerid, 10.0, -1609.12,89.46,-0.59) || IsPlayerInRangeOfPoint(playerid, 10.0, -831.60,1514.38,12.21) || IsPlayerInRangeOfPoint(playerid, 10, -169.18,1183.21,12.21) || IsPlayerInRangeOfPoint(playerid, 10, 1482.51,-1791.82,9.1))//LS
With this;
pawn Код:
for(new i=0; i<sizeof(gBankLocation); i++)
{
if(IsPlayerInRangeOfPoint(playerid,10.0,gBankLocation[i][BankX],gBankLocation[i][BankY],gBankLocation[i][BankZ]))
{
if(HasRobbed[playerid] == 0)
//your code

}
}//dont forget this extra bracket from   for(new i=0; i<sizeof(gBankLocation); i++)
have fun!


Re: Command not working - Captain_jeffree95 - 16.05.2013

We tried that and it didnt work we dont know what to do.


Re: Command not working - radiobizza - 16.05.2013

You have the enumerations?


Re: Command not working - AIped - 16.05.2013

Tell us exactly what did not work after you tried to do it my way, and show any warnings or errors you have in your script if you have any.


Re: Command not working - kiloman3 - 16.05.2013

after replacing the parts we went in and entered the marker again and try the command and it returns nothing again it will work with one bank but as soon as you put more than one it stops working and it is really odd.