Best way to do a timer for RP servers? - 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)
+--- Thread: Best way to do a timer for RP servers? (
/showthread.php?tid=452724)
Best way to do a timer for RP servers? -
Jernu - 22.07.2013
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?
Re: Best way to do a timer for RP servers? -
JimmyCh - 22.07.2013
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.
Re: Best way to do a timer for RP servers? -
Jernu - 22.07.2013
I know how to do it, I meant what's the best way of doing it

, out those two above.
Thanks anyway!
Re: Best way to do a timer for RP servers? -
BigGroter - 22.07.2013
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.
Re: Best way to do a timer for RP servers? -
Jernu - 22.07.2013
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...