SA-MP Forums Archive
/rob problem - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /rob problem (/showthread.php?tid=165226)



/rob problem - ScottCFR - 03.08.2010

I made a rob commad earlier, it seems as if you /rob nothing happens. like under the command it just returns 0.

pawn Код:
if(!strcmp(cmdtext, "/rob", true))
    {
        if(LCS_IsPlayerInAnyCheckpoint(playerid))
        {
            if(AccountInfo[playerid][ROBBED] == 0)
            {
                switch(random(3))
                {
                    case 1:
                    {
                        new rCash = random(25000);
                        GivePlayerMoney(playerid, rCash);
                        format(string, sizeof(string), "You have robbed %d!",rCash);
                        SendClientMessage(playerid, GREEN, string);
                    }
                    case 2: SendClientMessage(playerid, RED, "You have failed at robbing! RUN!!!");
                    case 3: SendClientMessage(playerid, RED, "You have failed at robbing! RUN!!!");
                }
                AccountInfo[playerid][ROBBED] = 1;
                SetTimerEx("Robbed",150000,0,"%d",playerid);
            }
            else SendClientMessage(playerid, RED, "You must wait before robbing again!");
        }
        else SendClientMessage(playerid, RED, "You aren't at any area to rob!");
        return 1;
    }



Re: /rob problem - PotH3Ad - 04.08.2010

pawn Код:
if(!strcmp(cmdtext, "/rob", true, 4))
{
    if(!LCS_IsPlayerInAnyCheckpoint(playerid)) return SendClientMessage(playerid, RED, "You aren't at any area to rob!");
    if(AccountInfo[playerid][ROBBED] == 1) return SendClientMessage(playerid, RED, "You must wait before robbing again!");

    switch(random(3))
    {
        case 1:
        {
            new rCash = random(25000);
            GivePlayerMoney(playerid, rCash);
            format(string, sizeof(string), "You have robbed %d!", rCash);
            SendClientMessage(playerid, GREEN, string);
        }
        default: return SendClientMessage(playerid, RED, "You have failed at robbing! RUN!!!");
    }

    AccountInfo[playerid][ROBBED] = 1;
    SetTimerEx("Robbed", 150000, 0, "i", playerid);
    return 1;
}



Re: /rob problem - ScottCFR - 04.08.2010

That does the same thing. I'll just write it different.


Re: /rob problem - ScottCFR - 04.08.2010

Fixed****