SetPlayerRaceCheckpoint - 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: SetPlayerRaceCheckpoint (
/showthread.php?tid=269987)
SetPlayerRaceCheckpoint -
park4bmx - 18.07.2011
i don't really get how
SetPlayerRaceCheckpoint works
i got this
pawn Код:
//my frist checkpoint
SetPlayerRaceCheckpoint(playerid,3,1775.46765137,-2593.12890625,12.81182575,0,0,0,10.0);
PilotCheckpoint[playerid]=1;
//then when it gets picked up
public OnPlayerEnterRaceCheckpoint(playerid)
{
if(PilotCheckpoint[playerid]==1)
{
SetPlayerRaceCheckpoint(playerid,3,1474.51684570,-2592.75708008,12.81182575,0,0,0,10.0);
PilotCheckpoint[playerid]=2;
}
if(PilotCheckpoint[playerid]==2)
{
SetPlayerRaceCheckpoint(playerid,3,1341.51184082,-2620.22851562,61.48181915,0,0,0,10.0);
PilotCheckpoint[playerid]=3;
}
//ETC....
well the proble is that i get the first one and then it goes straight to the last one
Re: SetPlayerRaceCheckpoint -
Donya - 18.07.2011
and the problem is?
https://sampwiki.blast.hk/wiki/SetPlayerRaceCheckpoint
pawn Код:
//my frist checkpoint
SetPlayerRaceCheckpoint(playerid,3,1775.46765137,-2593.12890625,12.81182575,1474.51684570,-2592.75708008,12.81182575,10.0);
PilotCheckpoint[playerid]=1;
//the nwhen it gets picked up
public OnPlayerEnterRaceCheckpoint(playerid)
{
if(PilotCheckpoint[playerid]==1)
{
SetPlayerRaceCheckpoint(playerid,3,1474.51684570,-2592.75708008,12.81182575,1341.51184082,-2620.22851562,61.48181915,10.0);
PilotCheckpoint[playerid]=2;
}
if(PilotCheckpoint[playerid]==2)
{
SetPlayerRaceCheckpoint(playerid,3,1341.51184082,-2620.22851562,61.48181915,nextcpx,nextcpy,nextcpz,10.0);
PilotCheckpoint[playerid]=3;
}
//ETC....
//last checkpoint
SetPlayerRaceCheckpoint(playerid,4,lastcpx,lastcpy,lastcpz,lastcpx,lastcpy,lastcpz,10.0);
PilotCheckpoint[playerid]=0;
Re: SetPlayerRaceCheckpoint -
Vince - 18.07.2011
Use elseif or switch instead.
Re: SetPlayerRaceCheckpoint -
park4bmx - 18.07.2011
Quote:
Originally Posted by Donya
and the problem is?
https://sampwiki.blast.hk/wiki/SetPlayerRaceCheckpoint
pawn Код:
//my frist checkpoint SetPlayerRaceCheckpoint(playerid,3,1775.46765137,-2593.12890625,12.81182575,1474.51684570,-2592.75708008,12.81182575,10.0); PilotCheckpoint[playerid]=1;
//the nwhen it gets picked up public OnPlayerEnterRaceCheckpoint(playerid) { if(PilotCheckpoint[playerid]==1) { SetPlayerRaceCheckpoint(playerid,3,1474.51684570,-2592.75708008,12.81182575,1341.51184082,-2620.22851562,61.48181915,10.0); PilotCheckpoint[playerid]=2; } if(PilotCheckpoint[playerid]==2) { SetPlayerRaceCheckpoint(playerid,3,1341.51184082,-2620.22851562,61.48181915,nextcpx,nextcpy,nextcpz,10.0); PilotCheckpoint[playerid]=3; } //ETC....
//last checkpoint
SetPlayerRaceCheckpoint(playerid,4,lastcpx,lastcpy,lastcpz,lastcpx,lastcpy,lastcpz,10.0); PilotCheckpoint[playerid]=0;
|
well i know that but let me quote my self
Quote:
Originally Posted by park4bmx
well the problem is that i get the first one and then it goes straight to the last one
|
Re: SetPlayerRaceCheckpoint -
Donya - 18.07.2011
Quote:
Originally Posted by park4bmx
i don't really get how SetPlayerRaceCheckpoint works
i got this
pawn Код:
//my frist checkpoint SetPlayerRaceCheckpoint(playerid,3,1775.46765137,-2593.12890625,12.81182575,0,0,0,10.0); PilotCheckpoint[playerid]=1;
//then when it gets picked up public OnPlayerEnterRaceCheckpoint(playerid) { if(PilotCheckpoint[playerid]==1) { SetPlayerRaceCheckpoint(playerid,3,1474.51684570,-2592.75708008,12.81182575,0,0,0,10.0); PilotCheckpoint[playerid]=2; } if(PilotCheckpoint[playerid]==2) { SetPlayerRaceCheckpoint(playerid,3,1341.51184082,-2620.22851562,61.48181915,0,0,0,10.0); PilotCheckpoint[playerid]=3; } //ETC....
well the proble is that i get the first one and then it goes straight to the last one
|
as Vince said, use switch or elseif, or use return 1;
Quote:
Originally Posted by park4bmx
well i know that but let me quote my self
|
that wasn't there when I clicked the reply button, sorry.
Re: SetPlayerRaceCheckpoint -
park4bmx - 18.07.2011
Quote:
Originally Posted by Vince
Use elseif or switch instead.
|
Quote:
Originally Posted by Donya
as Vince said, use switch or elseif, or use return 1;
that wasn't there when I clicked the reply button, sorry.
|
yh yh ill try that
TNX
EDIT
Awesome works perfect
BIG TNX