I need vehicle tele
#1

Hey guys when player goto any teleport player state drive
Reply
#2

pawn Код:
if(GetPlayerState(playerid) == 2)
{
      SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
      LinkVehicleToInterior(GetPlayerVehicleID(playerid), interior);
      SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), virtualworld);
}
Reply
#3

Honestly, I don't know what you're asking. I'm going to try to help by assuming that you're asking, "How do you teleport a player when he enters the state as a 'driver'?"

Under OnPlayerEnterVehicle create an 'if' statement similar to the one I'll create below.

pawn Код:
if(ispassenger == 0) // This says that he's the driver
{
       // Teleport player/vehicle to where ever you want here.
}
Reply
#4

pawn Код:
forward public Hooked_SetPlayerPos(playerid,Float:x,Float:y,Float:z);
public Hooked_SetPlayerPos(playerid,Float:x,Float:y,Float:z)
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        SetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
    }
    else
    {
        SetPlayerPos(playerid,x,y,z);
    }
}
#define SetPlayerPos Hooked_SetPlayerPos
Use SetPlayerPos normally.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)