OnPlayerEnterCheckpoint
#1

I'm total beginner at pawno so I'm coming here for some support.

I was wondering if it's possible that when I drive ( with a car ) on created "SetPlayerCheckpoint" it teleports me to another destination. If yes, I would appreciate if someone would create a little example or tutorial.

Thank you.
Reply
#2

EDIT:
I'm so sorry that I've misread,I thought you're asking how you can teleport from one checkpoint to another.
Sorry!
Reply
#3

First, you set the checkpoint for the playerid, so make it:

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate  == PLAYER_STATE_DRIVER)
    {
    SetPlayerCheckpoint(...);
    }
   
    return 1;
}
And to set the vehicle pos:

pawn Код:
public OnPlayerEnterCheckPoint(playerid)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
    SetVehiclePos(GetPlayerVehicleID(playerid),X,Y,Z);
    }

    return 1;
}
Reply
#4

Alright, thanks for help, but how to change the size of CP? For me it's huge...
Reply
#5

The last param in SetPlayerCheckpoint declares the size. 1.5 to 2.5 is a reasonable size for a checkpoint.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)