How to get checkpoint id's. - 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: How to get checkpoint id's. (
/showthread.php?tid=203178)
How to get checkpoint id's. -
Haydz - 26.12.2010
i'm aware i most likely need to assign a checkpoint id somehow.
pawn Код:
public OnPlayerConnect(playerid)
{
//other sutff.
CreateDynamicCP(-2024.0315, 395.4877, 35.1719, 1.0, -1,-1, -1, 20.0);
CreateDynamicCP(284.7085, -41.5060, 1001.5156, 1.0, -1,-1, -1, 20.0); //thinking setting 2 checkpoints at the same time could be causing it to bug.
return 1;
}
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
OnPlayerEnterDynamicCP(playerid, checkpointid);
{
SetPlayerPos(playerid, 286.148986,-40.644397,1001.515625);
SetPlayerInterior(playerid, 1);
inammu[playerid] = 1;
}
OnPlayerEnterDynamicCP(playerid, checkpointid);
{
SetPlayerInterior(playerid, 0);
inammu[playerid] = 0;
leaveammu(playerid);
}
return 1;
}
Thanks in advance.
Re: How to get checkpoint id's. -
Flyfishes - 26.12.2010
pawn Код:
new checkpoint1;
new checkpoint2;
public OnPlayerConnect(playerid)
{
//other sutff.
checkpoint1 = CreateDynamicCP(-2024.0315, 395.4877, 35.1719, 1.0, -1,-1, -1, 20.0);
checkpoint2 = CreateDynamicCP(284.7085, -41.5060, 1001.5156, 1.0, -1,-1, -1, 20.0); //thinking setting 2 checkpoints at the same time could be causing it to bug.
return 1;
}
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == checkpoint1)
{
SetPlayerPos(playerid, 286.148986,-40.644397,1001.515625);
SetPlayerInterior(playerid, 1);
inammu[playerid] = 1;
}
if(checkpointid == checkpoint1)
{
SetPlayerInterior(playerid, 0);
inammu[playerid] = 0;
leaveammu(playerid);
}
return 1;
}
Re: How to get checkpoint id's. -
Haydz - 26.12.2010
Works like a charm, thanks man.