30.08.2012, 17:33
pawn Код:
#include <a_samp>
new ScoreTimer[MAX_PLAYERS];
new ScoreTimerr[MAX_PLAYERS];
forward UpdateScore(playerid);
public OnPlayerConnect(playerid)
{
ScoreTimerr[playerid] = SetTimerEx("UpdateScore", 1000, true, "i", playerid);
ScoreTimer[playerid] = 0;
return 1;
}
public OnPlayerDisconnect(playerid)
{
KillTimer(ScoreTimerr[playerid]);
return 1;
}
public UpdateScore(playerid)
{
ScoreTimer[playerid] ++;
if(ScoreTimer[playerid] == 60)
{
SetPlayerScore(playerid, GetPlayerScore(playerid) +1);
ScoreTimer[playerid] = 0;
}
return 1;
}