First add this:
Код:
OnGameModeInit
{
new checkpoint[MAX_PLAYERS];
new Timer;
SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
return 1;
}
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
Код:
public OnPlayerEnterCheckpoint(playerid) // If the player enters a particluar checkpoint
{
Timer = SetTimerEx("GiveStats", 20000, false, "i", playerid);
checkpoint[playerid] = 1;
return 1;
}
if you want player to fail if he leaves checkpoint, then add this:
Код:
public OnPlayerLeaveCheckpoint(playerid)
{
if(checkpoint[playerid] == 1)
{
KillTimer(Timer);
checkpoint[playerid] = 0;
}
return 1;
}
so, if player succeds:
Код:
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");
Hope I helped you.