17.12.2012, 13:32
I need help on this =P i want that when a player achieves 1 hour online, he gets 1 score point
new gOnlineTimer[ MAX_PLAYERS ];
//making a global variable to use later when killing the looping timer
gOnlineTimer[ playerid ] = SetTimerEx( "HourScoreIncome", 60*60*1000, true, "i", playerid );
//here we initialize the timer, and assigns the global variable as its ID. The timer will loop every 60*60*1000th millisecond, which is every hour.
KillTimer( gOnlineTimer[ playerid ] );
//killing the timer so that it won't run when the player disconnects
forward HourScoreIncome(playerid);
public HourScoreIncom(playerid)
return SetPlayerScore( playerid, GetPlayerScore( playerid ) + 1 );
//simply adding 1 to the player's current score (the timer function)