12.08.2010, 16:58
Quote:
pawn Код:
|
pawn Код:
new OnlineTimer[MAX_PLAYERS];
enum pinfo
{
MinutesPlayed,
HoursPlayed
}
new PInfo[MAX_PLAYERS][pinfo];
onplayerconnect:
OnlineTimer[playerid] = SetTimerEx("OnlineTimeUpdate", 60000, 1, "i", playerid);
forward OnlineTimeUpdate(playerid);
public OnlineTimeUpdate(playerid)
{
PInfo[playerid][MinutesPlayed] ++;
if(PInfo[playerid][MinutesPlayed] == 60)
{
PInfo[playerid][HoursPlayed] ++;
SetPlayerScore(playerid,PInfo[playerid][HoursPlayed]);
PInfo[playerid][MinutesPlayed] = 0;
}
}