SA-MP Forums Archive
Checkpoint for all players - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Checkpoint for all players (/showthread.php?tid=524833)



Checkpoint for all players - alibalicharlton - 08.07.2014

If I wanted to set up a marker for a race between players on my server would using SetPlayerCheckpoint show the marker for all the players?

If I then used OnPlayerEnterCheckpoint to remove the marker when the first player enters would this remove it for all the players?

I can't find anything on the wiki to confirm this. If anyone has any past experience with this, can I load these markers from a filterscript for all users, or would they all have to be done in gamemodes?

Thanks!


Re: Checkpoint for all players - Affan - 08.07.2014

pawn Код:
foreach(new i : Player)
{
    if(inrace[i] == 1) // Change this
    {
        SetPlayerCheckpoint(i, x, y, z); //Insert your cordinates
    }
}
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(inrace[playerid] == 1)
    {
        if(RaceCheckPoint[playerid] == LAST_CHECKPOINT) // Change ofcourse
        {
            foreach(new i : Player)
            {
                DisablePlayerCheckpoint(i);
            }
        }
    }
    return 1;
}



Re: Checkpoint for all players - alibalicharlton - 08.07.2014

Quote:
Originally Posted by Affan
Посмотреть сообщение
pawn Код:
foreach(new i : Player)
{
    if(inrace[i] == 1) // Change this
    {
        SetPlayerCheckpoint(i, x, y, z); //Insert your cordinates
    }
}
Great, thanks Affan. How could I add players to a race array?