26.02.2014, 13:26
(
Последний раз редактировалось xKolle; 16.08.2014 в 06:26.
)
First add this:
timer is new timer variable which will determine how much time we need to wait in checkpoint.
checkpoint will determine max cps we can use.
next
if you want player to fail if he leaves checkpoint, then add this:
so, if player succeds:
Hope I helped you.
Код:
OnGameModeInit { new checkpoint[MAX_PLAYERS]; new Timer; SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size); return 1; }
checkpoint will determine max cps we can use.
next
Код:
public OnPlayerEnterCheckpoint(playerid) // If the player enters a particluar checkpoint { Timer = SetTimerEx("GiveStats", 20000, false, "i", playerid); checkpoint[playerid] = 1; return 1; }
Код:
public OnPlayerLeaveCheckpoint(playerid) { if(checkpoint[playerid] == 1) { KillTimer(Timer); checkpoint[playerid] = 0; } return 1; }
Код:
forward GiveStats(playerid); public GiveStats(playerid) { SetPlayerScore(playerid,GetPlayerScore(playerid)+10 ); //"10" is number of score player will receive, feel free to change it GivePlayerMoney(playerid,9999); //"9999" is money player will receive SendClientMessage(playerid, 0x0000FF ,"You've capture the zone and received 9999 $ and10 score");