Count online time
#1

hi,

i have this system to count a players online time and giving 500 score for an hour a player has been online but for some reason it doesnt work the right way.
I get the score message every 20 minutes instead of every hour only once!
Wheres the prob?

pawn Код:
new Hours[MAX_PLAYERS];
new Minutes[MAX_PLAYERS];
new OnlineCheck[MAX_PLAYERS];

//OnPlayerConnect
OnlineCheck[playerid] = SetTimerEx("TimePlayed",60000,1,"playerid",playerid);
Minutes[playerid] = 0;
Hours[playerid] = 0;

//OnPlayerDisconnect
KillTimer(OnlineCheck[playerid]);
OnlineCheck[playerid]=-1;

//timer
forward TimePlayed(playerid);
public TimePlayed(playerid)
{
    Minutes[playerid]++;
    if(Minutes[playerid] == 60)
    {
    Hours[playerid]++;
    Minutes[playerid] = 0;
    SetPlayerScore(playerid,GetPlayerScore(playerid)+15);
        SendClientMessage(playerid,-1,"You got 500 score cause youve been online for 1 hour!");
    }
    return 1;
}
Reply


Messages In This Thread
Count online time - by PawnoQ - 28.11.2011, 19:42
Re: Count online time - by IceCube! - 28.11.2011, 19:45
Re: Count online time - by PawnoQ - 28.11.2011, 19:49
Re: Count online time - by IceCube! - 28.11.2011, 19:54
Re: Count online time - by Nodroz - 28.11.2011, 20:03
Re: Count online time - by IceCube! - 28.11.2011, 20:06
Re: Count online time - by PawnoQ - 28.11.2011, 20:28
Re: Count online time - by fordawinzz - 28.11.2011, 20:51
Re: Count online time - by PawnoQ - 29.11.2011, 13:27
Re: Count online time - by fordawinzz - 29.11.2011, 13:32

Forum Jump:


Users browsing this thread: 4 Guest(s)