How do I disable a checkpoint? - 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 do I disable a checkpoint? (
/showthread.php?tid=256613)
How do I disable a checkpoint? -
[IL]HeHu - 21.05.2011
How do I remove a checkpoint in Incognito's plugin.
I did it like that:
PHP код:
DestroyDynamicCP(CurrentCP[playerid]);
But for some reason the red is still there.
Re: How do I disable a checkpoint? -
CrazyBlob - 21.05.2011
on ur create checkpoint
CurrentCP[playerid] = CreateDynamicCP(...
Re: How do I disable a checkpoint? -
[IL]HeHu - 21.05.2011
Still not working for some reason...
Re: How do I disable a checkpoint? -
Stigg - 21.05.2011
Would help if we could see the code.
Re: How do I disable a checkpoint? -
[IL]HeHu - 21.05.2011
Top of the script:
PHP код:
#define CP_LOADB 7
Inside a callback:
PHP код:
CreateDynamicCP(1608.5857,-1497.2982,13.2395,10.0,-1,-1,playerid,100.0);
CurrentCP[playerid] = CP_LOADB;
Inside a timer which starts there ^
PHP код:
DestroyDynamicCP(CP_LOADB);
Re: How do I disable a checkpoint? -
Vince - 21.05.2011
Do it like CrazyBlob said. In your code, you can never be sure that the CP created will be ID 7, as these checkpoints are randomly created amongst all players and so they will all have a different ID.
Re: How do I disable a checkpoint? -
Amit_B - 21.05.2011
^^ that's right Vince.
CurrentCP of playerid will be 7 but DestroyDynamicCP requires checkpointid, which is supposed to be an number of the checkpoint that you've create using CreateDynamicCP.
using
pawn Код:
CurrentCP[playerid] = CreateDynamicCP(1608.5857,-1497.2982,13.2395,10.0,-1,-1,playerid,100.0);
and then
pawn Код:
DestroyDynamicCP(CurrentCP[playerid]);
it may work.
Re: How do I disable a checkpoint? -
xalith - 21.05.2011
pawn Код:
new cpoint;
cpoint = CreateDynamic.......
DestroyDynamicCheckpoint(cpoint....);
Re: How do I disable a checkpoint? -
[IL]HeHu - 21.05.2011
I did what Amit_B and Vince told me to, but now:
PHP код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(CurrentCP[playerid] == CP_LOADB && IsPlayerInAnyVehicle(playerid) && GetVehicleModel(GetPlayerVehicleID(playerid)) == 414)
{
How do I check if the person is in this exact checkpoint then?
Re: How do I disable a checkpoint? -
[IL]HeHu - 22.05.2011
Help, anybody?