Score Timer
#5

Well,as TheDeath specified,I do rely on the fact that at the top of your gamemode you have:
pawn Код:
new seconds[MAX_PLAYERS];
YOU might have forget something very,VERY IMPORTANT,I hope you did not,and that important thing being this:
pawn Код:
public OnPlayerConnect(playerid)
{
   seconds[playerid]=0;
   return 1;
}
I hope you initialized seconds as 0,when player connects,otherwise,that's definetely the problem what's causing the bug.
And in the end,here's a better layout for your timer:
pawn Код:
forward scoretimer();
public scoretimer()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
         seconds[i] ++;
         if(seconds[i] >= 1800)
         {
            SetPlayerScore(i, GetPlayerScore(i) + 1);
            seconds[i] = 0;
         }
       }
    }
    return 1;
}
Hopefully,that works.
Reply


Messages In This Thread
Score Timer - by kbalor - 27.07.2012, 12:54
Re: Score Timer - by Cjgogo - 27.07.2012, 13:00
Re: Score Timer - by TheDeath - 27.07.2012, 13:02
Re: Score Timer - by kbalor - 27.07.2012, 13:07
Re: Score Timer - by Cjgogo - 27.07.2012, 13:13
Re: Score Timer - by kbalor - 27.07.2012, 15:52

Forum Jump:


Users browsing this thread: 1 Guest(s)