/rob problem
#1

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

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;
}
Reply
#3

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

Fixed****
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)