Quote:
Originally Posted by Cjgogo
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.
|
EDIT: Working fine! Just a mistake i though 500 is 5 seconds. LOLOL
My bad. +rep