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)
+--- Thread: Checkpoint (
/showthread.php?tid=502386)
Checkpoint -
TLN - 23.03.2014
I've never used checkpoints before, but you won't get teleported into LVPD when you enter the checkpoint?
pawn Код:
public OnCheckpointEnter(playerid, checkpointid)
{
VerifyCheckpoint(playerid);
switch(checkpointid)
{
case LVPD:
{
SetPlayerPos(playerid, 238.66, 138.68, 1003.02);
SetPlayerInterior(playerid, 3);
SetPlayerVirtualWorld(playerid, 1);
return 1;
}
}
return 1;
}
Re: Checkpoint -
Vince - 23.03.2014
How is this callback called? I hope you realize you can't just make stuff up?
Re: Checkpoint -
MP2 - 23.03.2014
Defining a checkpoint ID variable as 'LVPD' is terrible naming. By looking at that variable name, how on earth are you meant to know what it's for? At least prefix it with CP_ for checkpoint...
Re: Checkpoint -
CutX - 23.03.2014
visit the wiki, there's a nice example too
https://sampwiki.blast.hk/wiki/OnPlayerEnterCheckpoint
Re: Checkpoint -
MP2 - 23.03.2014
Quote:
Originally Posted by CutX
|
He is using a streamer. That is irrelevant.
Re: Checkpoint -
Kar - 23.03.2014
Show the VerifyCheckpoint checkpoint function and the create checkpoint line / code
Re : Checkpoint -
TLN - 23.03.2014
I'm using this.
https://sampforum.blast.hk/showthread.php?tid=70963
This is the VerifyCheckpoint function (I think) in the include.
pawn Код:
stock VerifyCheckpoint(__playerid){
if(_p_VisibleCheckpoint[__playerid] >= 0){
OnCheckpointEnter(__playerid, _checkpoints[_p_VisibleCheckpoint[__playerid]][_chp_id]);
return 1;
}
return 0;
}
stock VerifyCheckpointe(__playerid){
if(_p_VisibleCheckpoint[__playerid] >= 0){
OnCheckpointEXIT(__playerid, _checkpoints[_p_VisibleCheckpoint[__playerid]][_chp_id]);
return 1;
}
return 0;
}
And this is the create checkpoint.
pawn Код:
public OnGameModeInit()
{
CreateCheckpoint(GLOBAL_OWNER_ID, LVPD, 2287.0176,2432.5933,10.8203, 1.0);
SetCheckpointInterior(LVPD, 0);
return 1;
}
Re: Checkpoint -
TLN - 25.03.2014
Bump.
AW: Checkpoint -
Macronix - 25.03.2014
VerifyCheckpoint belongs to or needs to be in OnPlayerEnterCheckpoint and not OnCheckpointEnter.
Re: Checkpoint -
TLN - 25.03.2014
I already have that.
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
VerifyCheckpoint(playerid);
return 1;
}