Time limiter for /rob help!
#6

Here's a way, there is no need for a timer. You will need to edit make the "iLastRobbery" var an array and assign robbery shops ids to it.

pawn Код:
new iLastRobbery;

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/rob", true) == 0) // If they type /rob
    {
        if(IsPlayerInCheckpoint(playerid))
        {
            if(GetTickCount() > iLastRobbery) //if iLastRobbey is less than tickcount. ie. iLastRobbey = GetTickCount + 60 seconds.
            {
                GivePlayerMoney(playerid, random(2000+1));
                iLastRobbery = GetTickCount() + 60000;//iLastRobbery is GetTickCount plus 60 secons
                return 1;
            }
            else {
                SendClientMessage(playerid, 0xFF0000AA, "ERROR: That shop has only recently been robbed.");
                return 1;
            }
        }
    }
    return 0;
}
You need to keep in mind that a player will be able to rob cash at any checkpoint since you only check if they are in a checkpoint and not in a specific checkpoint.
Reply


Messages In This Thread
Time limiter for /rob help! - by Panormitis - 28.09.2011, 08:16
Re: Time limiter for /rob help! - by [Diablo] - 28.09.2011, 08:20
Re: Time limiter for /rob help! - by Panormitis - 28.09.2011, 09:33
Re: Time limiter for /rob help! - by [MWR]Blood - 28.09.2011, 09:36
Re: Time limiter for /rob help! - by suhrab_mujeeb - 28.09.2011, 09:39
Re: Time limiter for /rob help! - by iggy1 - 28.09.2011, 09:43
Re: Time limiter for /rob help! - by [Diablo] - 28.09.2011, 10:00
Re: Time limiter for /rob help! - by Panormitis - 28.09.2011, 10:10
Re: Time limiter for /rob help! - by iggy1 - 28.09.2011, 10:19

Forum Jump:


Users browsing this thread: 1 Guest(s)