Bank anti-rob timer.
#1

On my server for example:
Player 1 : /rob [ you need to go to the red checkpoint (SCM)]
Player 2: /ROB ! [ and work like to player 1]


how can i make after a rob all players need to wait 30 minutes to rob again ?
Reply
#2

pawn Код:
new _timer = 0;

CMD:rob(..)
{
      if( (_timer - GetTickCount()) < TIME_YOU_WANT) dont allow robbery
      else
      _timer = GetTickCount();
}
Reply
#3

pawn Код:
new RobTimer[MAX_PLAYERS];

    if (strcmp("/rob", cmdtext, true) == 0)
    {
        if[RobTimer[playerid] == 0)
        {
            RobTimer[playerid] = 1;
            SetTimerEx("CanRobAgain",30*60000,false,"i",playerid);
            //    Rest of your code goes here (GivePlayerMoney, etc)
        }
        else
        {
            SendClientMessage(playerid,0xFFFFFFFF, "You have to wait 30 minutes to rob again.");
        }
        return 1;
    }

forward CanRobAgain (i);
public CanRobAgain (i)
{
    RobTimer[i] = 0;
    SendClientMessage(i, 0xFFFFFFFF, "You can now rob again.");
    return 1;
}
Reply
#4

no good.
1)Don't understand nothing what he do
2)NEED FOR ALL PLAYERS NOT FOR ONLY ONE
Reply
#5

Make a loop
for(new i = 0; i < MAX_PLAYERS; i ){// Do stuff here}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)