Checkpoint Issue - 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 Issue (
/showthread.php?tid=299684)
Checkpoint Issue -
Infamous - 27.11.2011
Can anyone tell me why the variables are being ignored and the last checkpoint is called no matter what checkpoint is the current target?
pawn Код:
public OnPlayerSpawn(playerid)
{
if(FirstCheckpoint == 1 && BlastDoorsOpen == 0 && SecDoorsOpen == 0 && JetpackStolen == 0)
{
SetPlayerCheckpoint(playerid, 211.6523, 1812.2909, 21.8594, 1.0);
}
else if(FirstCheckpoint == 0 && BlastDoorsOpen == 0 && SecDoorsOpen == 0 && JetpackStolen == 0)
{
SetPlayerCheckpoint(playerid, 279.4721, 1855.4517, 8.7649, 1.0);
}
else if(FirstCheckpoint == 0 && BlastDoorsOpen == 1 && SecDoorsOpen == 0 && JetpackStolen == 0)
{
SetPlayerCheckpoint(playerid, 268.6385, 1883.4900, -30.0938, 1.0);
}
else if(FirstCheckpoint == 0 && BlastDoorsOpen == 1 && SecDoorsOpen == 1 && JetpackStolen == 0)
{
SetPlayerCheckpoint(playerid, 427.6015, 2530.6992, 16.6272, 2.0);
}
return 1;
}
It should work fairly straight forward, the variable values tell the server what checkpoint to set. Yet for some reason the last checkpoint gets called regardless.
Re: Checkpoint Issue -
Tanush123 - 27.11.2011
First use steamer for your checkpoints as in CreateDynamicCP to make more CP:
http://forum.sa-mp.com/showthread.ph...hlight=steamer
Second problem you must add [playerid] in front of them for example
pawn Код:
FirstCheckpoint[playerid] == 0
So for the first checkpoint it should be
pawn Код:
if(FirstCheckpoint[playerid] == 1 && BlastDoorsOpen[playerid] == 0 && SecDoorsOpen[playerid] == 0 && JetpackStolen[playerid] == 0)
{
SetPlayerCheckpoint(playerid, 211.6523, 1812.2909, 21.8594, 1.0);
}
Now you get steamer and check SetPlayerCheckpoint and edit the other variable with [playerid] in front
Re: Checkpoint Issue -
Infamous - 27.11.2011
Well I don't use a streamer as the checkpoints only become viewable at a certain distance and that isn't what I need, also the varibales are global so I don't need [playerid] attatched to them.
I just wanted to know if the code I posted above had anything wrong with it.
Thanks for replying though mate.
Re: Checkpoint Issue -
Tanush123 - 27.11.2011
you want it viewed at certain distance?