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)
+--- Thread: Checkpoints? (
/showthread.php?tid=284103)
Checkpoints? -
Luis- - 17.09.2011
Hi, I am wanting to know how I can use multiple "IsPlayerInCheckPoints" in the OnPlayerEnterCheckpoint. This is the code I have now, the first one works fine but the second checkpoint doesn't work.
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
new rand = random(sizeof(RandAirports));
if(IsPlayerInCheckpoint(playerid) == airportcheckpoint)
{
DisablePlayerCheckpoint(playerid);
airportcheckpoint1 = SetPlayerCheckpoint(playerid, RandAirports[rand][3], RandAirports[rand][4], RandAirports[rand][5], 2.5);
}
else if(IsPlayerInCheckpoint(playerid) == airportcheckpoint1)
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, COLOR_WHITE, "Radio: Well done, you have completed the travel.");
PlayerInfo[playerid][pLevel] += 5;
PlayerInfo[playerid][pMoney] += random(2555)+1000;
SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
SaveAccount(playerid);
}
return 1;
}
Re: Checkpoints? -
Backwardsman97 - 17.09.2011
That's not how you use that function. IsPlayerInCheckpoint just returns true if the player is in any checkpoint. And that would be unnecessary to check under OnPlayerEnterCheckpoint because obviously, they are in one. If you want more than one checkpoint, you need a checkpoint streamer.
Re: Checkpoints? -
RelaxCafe - 18.09.2011
Can't be done. Checkpoints don't have ids..