27.08.2012, 15:37
First..
You should do that timer like this:
pawn Код:
new OneSecondUpdateTimer[MAX_PLAYERS];
public OnPlayerConnect(playerid);
{
OneSecondUpdatetimer[playerid] = SetTimerEx("OneSecondUpdate", 1000, true, "i", playerid);
return 1;
}
pawn Код:
forward OneSecondUpdate(playerid);
public OneSecondUpdate(playerid)
{
PlayerInfo[playerid][pSeconds] ++;
if(PlayerInfo[playerid][pSeconds] == 60)
{
PlayerInfo[playerid][pSeconds] = 0;
PlayerInfo[playerid][pMinutes] ++;
if(PlayerInfo[playerid][pMinutes] == 60)
{
PlayerInfo[playerid][pMinutes] = 0;
PlayerInfo[playerid][pHours] ++;
if(PlayerInfo[playerid][pHours] == 4)
{
PlayerInfo[playerid][pHours] = 0;
PlayerInfo[playerid][pDays]++;
}
}
}
return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid)
{
KillTimer(OneSecondUpdateTimer[playerid]);
return 1;
}