SA-MP Forums Archive
[Help} SetPlayerScore - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Help} SetPlayerScore (/showthread.php?tid=286047)



[Help} SetPlayerScore - Jimbo01 - 26.09.2011

Код:
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]++;
new LevScore;
LevScore = PlayerInfo[playerid][Hour];
SetPlayerScore(playerid, LevScore);
}
}
why this dont sets my score on tab ?


Re: [Help} SetPlayerScore - aRoach - 26.09.2011

Have you a timer or something ?


AW: [Help} SetPlayerScore - Jimbo01 - 26.09.2011

yes 1 sec timer on "TimeOnServer"

TimeTimer = SetTimerEx("TimeOnServer", 1000, 1, "i", playerid);


Re: [Help} SetPlayerScore - Kostas' - 26.09.2011

Код:
SetTimer("playerscore", 60000, true);
First set a timer
Код:
forward playerscore();
public playerscore()
{
    for(new x; x<MAX_PLAYERS; x++)
    {
        if(!IsPlayerConnected(x)) continue;
        SetPlayerScore(x, GetPlayerScore(x) + 1);
    }
    return 1;
}
This, the player will get 1 score per minute.