Checkpoints return an ID? - 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 return an ID? (
/showthread.php?tid=83987)
Checkpoints return an ID? -
Abernethy - 28.06.2009
I was wondering if you could make say ..
pawn Код:
new Checkpoint:lalala;
if (CheckpointID == lalala)
{
// effect
}
Please correct me.
Re: Checkpoints return an ID? -
Grim_ - 28.06.2009
You're somewhat on the right track.
Try something like this:
pawn Код:
new CheckStatus[MAX_PLAYERS]; //Checkpoint to check the players next checkpoint
public OnPlayerSpawn(playerid)
{
SetPlayerCheckpoint(...);
CheckStatus[playerid] = 1;
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(CheckStatus[playerid] == 1)
{
CheckStatus[playerid] = 2;
SetPlayerCheckpoint(...);
}
//so on and so on
return 1;
}