13.03.2014, 17:58
Hi,
I made system to count minutes, hours and days online for player, but I don't know is it lagg or what? First time timer late 5-10sec but on 5th time it late 1 minute.
I put this on player login/register
and this is public for timer:
I made system to count minutes, hours and days online for player, but I don't know is it lagg or what? First time timer late 5-10sec but on 5th time it late 1 minute.
I put this on player login/register
Код:
SetTimerEx("TimeOnServer", 60000, 1, "i", playerid);
Код:
forward TimeOnServer(playerid); public TimeOnServer(playerid) { PlayerInfo[playerid][pMin] ++; if(PlayerInfo[playerid][pMin]>=60) { PlayerInfo[playerid][pHour]++; PlayerInfo[playerid][pMin]=0; if(PlayerInfo[playerid][pHour] < 60) { SendClientMessage(playerid, COLOR_GRAY, ""COL_YELLOW"[SERVER]: +1 Hour online! +5 Score and $5000"); sGivePlayerMoney(playerid, 5000); PlayerInfo[playerid][pCash] += 5000; SetPlayerScore(playerid, GetPlayerScore(playerid)+5); PlayerInfo[playerid][pScore] += 5; } } if(PlayerInfo[playerid][pHour]>=60) { PlayerInfo[playerid][pHour]=0; PlayerInfo[playerid][pDay]++; SendClientMessage(playerid, COLOR_GRAY, ""COL_YELLOW"[SERVER]: +1 Day online! +20 Score and $20000"); sGivePlayerMoney(playerid, 20000); PlayerInfo[playerid][pCash] += 20000; SetPlayerScore(playerid, GetPlayerScore(playerid)+20); PlayerInfo[playerid][pScore] += 20; } }