SA-MP Forums Archive
Checkpoints - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Checkpoints (/showthread.php?tid=198919)



Checkpoints - NuggaN_ - 13.12.2010

How do I create multiciple Checkpoints? I mean, there is a checkpoints, after you've entered it there comes a next, and next and next and next...
How can I do this?
I want to add it for Tutorials and for Jail


Re: Checkpoints - CyNiC - 13.12.2010

A base:

pawn Код:
new Float:CPs[3][3] = {
{0.0, 0.0 0.0},
{0.0, 0.0 0.0},
{0.0, 0.0 0.0},
};
//in a command, for example:
SetPlayerCheckpoint(playerid, CPs[0][0], CPs[0][1], CPs[0][2], 5.0);
SetPVarInt(playerid, "CP" 0);

public OnPlayerEnterCheckpoint(playerid)
{
    new pcp = GetPVarInt(playerid, "CP");
    SetPlayerCheckpoint(playerid, CPs[pcp + 1][0], CPs[pcp + 1][1], CPs[pcp + 1][2], 5.0);
    SetPVarInt(playerid, "CP", pcp+1);
    return 1;
}