Best way to do a timer for RP servers?
#1

What's the best way to do a Timer for RP servers?

When a player logins, set a timer for them only and when the timer reaches 3600000(60 minutes) payday.
Or
At a certain on a clock it gives out payday for everyone?
Reply
#2

Like this:
pawn Код:
OnGameModeInit
SetTimer("payday", 3600000, 1);

//Anywhere in your script
forward payday();
public payday()
{
    for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
    {
        GameTextForPlayer(i, "PAYDAY", 2000, 1);
        GivePlayerMoney(i, 5000); // or wtvr u wanna put for it like 3k etc
    }
    return 1;
}
This will work and give them all 5k every hour.
Reply
#3

I know how to do it, I meant what's the best way of doing it , out those two above.

Thanks anyway!
Reply
#4

None, make them receive +1 to a variable every minute, so they can /quit and play later and eventually receive a paycheck when it reaches 60.
Reply
#5

Quote:
Originally Posted by BigGroter
Посмотреть сообщение
None, make them receive +1 to a variable every minute, so they can /quit and play later and eventually receive a paycheck when it reaches 60.
Hm...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)