Checkpoint
#1

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;
}
Reply
#2

How is this callback called? I hope you realize you can't just make stuff up?
Reply
#3

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...
Reply
#4

visit the wiki, there's a nice example too
https://sampwiki.blast.hk/wiki/OnPlayerEnterCheckpoint
Reply
#5

Quote:
Originally Posted by CutX
Посмотреть сообщение
visit the wiki, there's a nice example too
https://sampwiki.blast.hk/wiki/OnPlayerEnterCheckpoint
He is using a streamer. That is irrelevant.
Reply
#6

Show the VerifyCheckpoint checkpoint function and the create checkpoint line / code
Reply
#7

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;
}
Reply
#8

Bump.
Reply
#9

VerifyCheckpoint belongs to or needs to be in OnPlayerEnterCheckpoint and not OnCheckpointEnter.
Reply
#10

I already have that.

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    VerifyCheckpoint(playerid);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)