Score by Playing hours
#4

Quote:
Originally Posted by Jakku
Посмотреть сообщение
pawn Код:
forward SetScore();

SetTimer("SetScore", 4000,1);

public SetScore()
{
        for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            SetPlayerScore(i, Player[playerid][PlayingHours]);
        }
     }
}
Just change the "4000" to your own value if you want so
Hmm, a fail code?


pawn Код:
new OnlineTimer[MAX_PLAYERS];
enum pinfo
{
    MinutesPlayed,
    HoursPlayed
}
new PInfo[MAX_PLAYERS][pinfo];

onplayerconnect:

OnlineTimer[playerid] = SetTimerEx("OnlineTimeUpdate", 60000, 1, "i", playerid);


forward OnlineTimeUpdate(playerid);
public OnlineTimeUpdate(playerid)
{
PInfo[playerid][MinutesPlayed] ++;
if(PInfo[playerid][MinutesPlayed] == 60)
{
PInfo[playerid][HoursPlayed] ++;
SetPlayerScore(playerid,PInfo[playerid][HoursPlayed]);
PInfo[playerid][MinutesPlayed] = 0;
}
}
Reply


Messages In This Thread
Score by Playing hours - by Rady - 12.08.2010, 10:02
Re: Score by Playing hours - by Rady - 12.08.2010, 16:53
Re: Score by Playing hours - by Jakku - 12.08.2010, 16:55
Re: Score by Playing hours - by 0ne - 12.08.2010, 16:58
Re: Score by Playing hours - by Jakku - 12.08.2010, 17:00
Re: Score by Playing hours - by Jakku - 12.08.2010, 17:02
Re: Score by Playing hours - by 0ne - 12.08.2010, 17:02
Re: Score by Playing hours - by Jakku - 12.08.2010, 17:04
Re: Score by Playing hours - by HyperZ - 12.08.2010, 17:08
Re: Score by Playing hours - by Rady - 12.08.2010, 17:34

Forum Jump:


Users browsing this thread: 1 Guest(s)