27.07.2012, 13:13
Well,as TheDeath specified,I do rely on the fact that at the top of your gamemode you have:
YOU might have forget something very,VERY IMPORTANT,I hope you did not,and that important thing being this:
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:
Hopefully,that works.
pawn Код:
new seconds[MAX_PLAYERS];
pawn Код:
public OnPlayerConnect(playerid)
{
seconds[playerid]=0;
return 1;
}
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;
}