27.07.2012, 22:51
I wouldn't do it this way but i would use a timer when a player connects then i would create a variable attached tot that timer, then i convert 6 hours into milliseconds (21600000) then set that timer for that players with that much amount of milliseconds then use SetPlayerScore(playerid,GetPlayerScore(playerid)+1 );
Make sure you create a callback with that timer running into.
Example:
Make sure you create a callback with that timer running into.
Example:
pawn Код:
new playedtimer[MAX_PLAYERS];
forward TimeOnServer(playerid);
public OnPlayerConnect(playerid)
{
playedtimer[playerid] = SetTimerEx("TimeOnServer", 21600000, 1, "i", playerid);
return 1;
}
public TimeOnServer(playerid) return SetPlayerScore(playerid,GetPlayerScore(playerid) +1); // use KillTimer(playedtimer); to stop the timer mostly used for when a player disconnects.