SA-MP Forums Archive
[Help/Request]Score timer help - 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/Request]Score timer help (/showthread.php?tid=312999)



[Help/Request]Score timer help - Notis123 - 23.01.2012

[B] I need someone to help me make a timer which gives you +1 score every 1 min
I made one but its buggy it bugs the whole score.
mine gives wrong score,last time it gave me 15 score because 15 players war online -______-
Can someone make me a right one ? or just help me.

I know this is a fuck-up but im kinda newbie in timers so.


Re: [Help/Request]Score timer help - [ABK]Antonio - 23.01.2012

This is how it would be
pawn Код:
new ScoreTimer;
public OnGameModeInit()
{
    ScoreTimer = SetTimer("ScoreTime", 60_000, true);
}
public OnGameModeExit()
{
    KillTimer(ScoreTimer);
}

forward ScoreTime(playerid);
public ScoreTime(playerid)
{
    new Score = GetPlayerScore(playerid);
    SetPlayerScore(playerid, Score+1);
}



Re: [Help/Request]Score timer help - DarkScripter - 23.01.2012

Try this:

pawn Код:
public OnGameModeInit()
{
    SetTimer("ScoreTime", 60_000, true);
}

forward ScoreTime(playerid)
public ScoreTime(playerid)
{
    for(new i,e = GetMaxPlayers(); i != e; ++i)
    {
        if(IsPlayerConnected(i))
        {
            SetPlayerScore(i, GetPlayerScore(i) +1);
        }
    }
}



Re: [Help/Request]Score timer help - Notis123 - 24.01.2012

Thank you both guys both of you got my rep+1