Doubt with a checkpoint thing
#1

Well my doubt is, how can i make an checkpoint appear at an custom position when the the player is near that position, example:

X player approach an entrance at x,y,z pos using 2.0 range, when i enteres that range a checkpoint appears, and after he leaves that range the same checkpoint destroys.
Reply
#2

Use a timer and IsPlayerInRangeOfPoint and then create the checkpoint
Reply
#3

But can you or someone show me an example?
Reply
#4

pawn Код:
public OnGameModeInit()
{
    SetTimer("AreaCheck", 1000, 1);
    return 0;
}

forward AreaCheck();
public AreaCheck()
{
    for (new playerid = 0, max = GetMaxPlayers(); playerid < m; playerid++)
    {
        if (IsPlayerConnected(playerid))
        {
            if (IsPlayerInRangeOfPoint(playerid, 2.0, x, y, z))
            {
                SetPlayerCheckpoint(playerid, x, y, z, 3.0);
            }
            else //lets disable it if he's to far away
            {
                DisablePlayerCheckpoint(playerid);
            }
        }
    }
}
Note that this will only work if this checkpoint is the only one on your server
Reply
#5

How so?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)