Online time bugged in /stats
#4

I don't know about you saving system.
Maybe this will help you.

pawn Код:
//firs Start a timer that runs every 1 seconds then ito the callback

//start the timer
SetTimerEx("TimeOnServer", 1000, 1, "i", playerid);

forward TimeOnServer(playerid);
public TimeOnServer(playerid)
{
PlayerInfo[playerid][Sec] ++;
if(PlayerInfo[playerid][Sec]>=60)
    {
        PlayerInfo[playerid][Min]++;
        PlayerInfo[playerid][Sec]=0;
    }
if(PlayerInfo[playerid][Min]>=60)
    {
        PlayerInfo[playerid][Min]=0;
        PlayerInfo[playerid][Hour]++;
    }
}
//and that's all you need to have a timer with [hours,mins,sec]

//This is to save it
INI_WriteInt(Acc,"Min",PlayerInfo[playerid][Min]);
INI_WriteInt(Acc,"Hour",PlayerInfo[playerid][Hour]);
INI_WriteInt(Acc,"Sec",PlayerInfo[playerid][Sec]);

//To load it
PlayerInfo[playerid][Min] = GetPVarInt(playerid, "Min");
PlayerInfo[playerid][Hour] = GetPVarInt(playerid, "Hour");
PlayerInfo[playerid][Sec] = GetPVarInt(playerid, "Sec");
Reply


Messages In This Thread
Online time bugged in /stats - by stormchaser206 - 24.09.2013, 16:50
Re: Online time bugged in /stats - by Finn - 24.09.2013, 17:05
Re: Online time bugged in /stats - by stormchaser206 - 24.09.2013, 17:12
Re: Online time bugged in /stats - by Champ - 24.09.2013, 17:42
Re: Online time bugged in /stats - by Konstantinos - 24.09.2013, 17:56
Re: Online time bugged in /stats - by stormchaser206 - 24.09.2013, 18:45
Re: Online time bugged in /stats - by stormchaser206 - 24.09.2013, 21:01
Re: Online time bugged in /stats - by stormchaser206 - 25.09.2013, 20:56

Forum Jump:


Users browsing this thread: 1 Guest(s)