27.04.2014, 19:54
Here you go:
pawn Код:
forward GiveUserScoreAndMoney();
public GiveUserScoreAndMoney()
{
for(new i=0; i < MAX_PLAYERS; i++) // A loop to go through every player
{
if(!IsPlayerConnected(i)) continue; // If player is not connected, then continue the loop
GivePlayerMoney(i, 5000); // Gives every player $5000
SetPlayerScore(i, GetPlayerScore(i)+5); //Gets every players score and increases it by 5
}
return 1;
}
//In OnGameModeInit:
SetTimer("GiveUserScoreAndMoney", 5000, true); // 5000 = 5 seconds (or 5000 ms) and true means that the timer repeats every 5 seconds