How to set up a checkpoint?
#6

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


Messages In This Thread
How to set up a checkpoint? - by 799023555 - 26.02.2014, 07:10
Re: How to set up a checkpoint? - by Knekt - 26.02.2014, 07:19
Re: How to set up a checkpoint? - by 799023555 - 26.02.2014, 07:28
Re: How to set up a checkpoint? - by Mriss - 26.02.2014, 07:28
Re: How to set up a checkpoint? - by 799023555 - 26.02.2014, 08:12
Re: How to set up a checkpoint? - by xKolle - 26.02.2014, 13:26

Forum Jump:


Users browsing this thread: 3 Guest(s)