06.01.2017, 13:02
Hello , how do i give a player +5 score every minute ?
Thanks .
is this code good ?
Thanks .
is this code good ?
Код:
new seconds[MAX_PLAYERS]; public OnGameModeInit() { SetTimer("scoretimer", 1000, true); return 1; } public OnPlayerConnect(playerid) { seconds[playerid] = 0; return 1; } forward scoretimer(); public scoretimer() { for(new i; i<MAX_PLAYERS; i++) { if(!IsPlayerConnected(i)) continue; seconds[i] ++; if(seconds[i] == 60) { SetPlayerScore(i, GetPlayerScore(i) + 5); seconds[i] = 0; } } return 1; }