[Help/Request]Score timer help
#1

[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.
Reply
#2

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);
}
Reply
#3

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);
        }
    }
}
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)