Command not working
#1

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
Reply
#2

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!
Reply
#3

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

You have the enumerations?
Reply
#5

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.
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)