SetTimerEx
#1

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
Код:
SetTimerEx("TimeOnServer", 60000, 1, "i", playerid);
and this is public for timer:
Код:
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;

    }
}
Reply


Messages In This Thread
SetTimerEx - by CroM256 - 13.03.2014, 17:58
Re: SetTimerEx - by Matess - 13.03.2014, 18:04
Re: SetTimerEx - by Ruben_Alonso - 13.03.2014, 18:05
Re: SetTimerEx - by CroM256 - 13.03.2014, 18:07
AW: SetTimerEx - by Macronix - 13.03.2014, 18:09
Re: SetTimerEx - by CroM256 - 13.03.2014, 18:11
Re: SetTimerEx - by Ruben_Alonso - 13.03.2014, 18:19
Re: SetTimerEx - by CroM256 - 13.03.2014, 18:23
Re: SetTimerEx - by Richie© - 13.03.2014, 18:26
Re: SetTimerEx - by CroM256 - 13.03.2014, 18:57

Forum Jump:


Users browsing this thread: 2 Guest(s)