Well, it depends. What kind of PayDay timer you want?
You want a 'global' one, which pays everyone at :00 minutes of every hour?
You want a 'global' with a minimum playing minutes to get it?
You want a player based one? When player reaches 60 minutes online, he gets a Payday?
LE: Just read your last sentece ...
Well, you can do like this:
pawn Код:
public OnGameModeInit()
{
SetTimer( "Payday", 60000, true );
}
This will set a timer, called "Payday" ( a public function more exactly), which occurs every 1 minute. Don`t worry, you won`t get payday every minute. You`ll understand later.
Now, we`ll make the Payday function:
pawn Код:
forward Payday();
public Payday()
{
new hh, mm, ss;
gettime( hh, mm, ss );
new String[ 75 ];
new prandom = random(5000); // THis is used for random paycheck, you can change it :)
if( mm == 0 ) // This checks if the minutes is :00
{
foreach (Player,i) // We loop through all online players, to give them $$ (Credits to ****** for this)
{
GivePlayerMoney(i, prandom);
format(String, sizeof String, "Paycheck! Recieved %d $.", prandom);
SendClientMessage(i, -1, String);
}
}
}
Well, that`s all ... it`s a simple payday, which gives every online player a random( 0 - 5000$).