Connected Time
#2

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....
Reply


Messages In This Thread
Connected Time - by TheWay - 27.03.2015, 14:37
Re: Connected Time - by De4dpOol - 27.03.2015, 14:46
Re: Connected Time - by CalvinC - 27.03.2015, 14:47
Re: Connected Time - by TheWay - 27.03.2015, 14:48
Re: Connected Time - by CalvinC - 27.03.2015, 14:57
Re: Connected Time - by TheWay - 27.03.2015, 15:00
Re: Connected Time - by CalvinC - 27.03.2015, 15:07
Re: Connected Time - by PowerPC603 - 27.03.2015, 17:37
Re: Connected Time - by TheWay - 28.03.2015, 06:28
Re: Connected Time - by De4dpOol - 28.03.2015, 07:57

Forum Jump:


Users browsing this thread: 4 Guest(s)