27.03.2015, 14:46
pawn Код:
//Out side all the call backs//
new PlayedTimer[MAX_PLAYERS];//Creating a variable, it is used to kill the timer.
new Time[MAX_PLAYERS] = 0;
forward IncreaseTime(playerid);//forwarding IncreaseTime(playerid).
//Under OnPlayerConnect and /back cmd
//Make sure to check the name of the player at OnPlayerConnect or it will set his time according to his id.
PlayerTimer[playerid] = SetTimerEx("IncreaseTime", 1000 * 60, 1, "i", playerid);//Making a one minute timer at OnPlayerConnect.
//In /sleep and Under OnPlayerDisconnect
KillTimer(PlayerTimer[playerid]);//Killing the Timer
public IncreaseTime(playerid)
{
Time[playerid]++;//Increasing Time by 1 every minute.
}
//At Payday//
new Prize[MAX_PLAYERS];
Prize[playerid] = Time/100;
GivePlayerMoney....