Teleport with car
#1

When my players do teleport when they are in a car they teleport to their destination without their car, how i can make when someone is in a vehicle and to teleport command to teleport with the vehicle together
Reply
#2

Well you have to change the command to only teleport the player when he's not in a car, otherwise teleport just the car.

pawn Код:
//command
new Float:x,Float:y,Float:z;
GetPlayerPos(GOTOPLAYER,x,y,z);
if (GetPlayerState(playerid)==PLAYER_STATE_DRIVER)SetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
else SetPlayerPos(playerid,x,y,z);
Reply
#3

Quote:
Originally Posted by SilentHuntR
Посмотреть сообщение
Well you have to change the command to only teleport the player when he's not in a car, otherwise teleport just the car.

pawn Код:
//command
new Float:x,Float:y,Float:z;
GetPlayerPos(GOTOPLAYER,x,y,z);
if (GetPlayerState(playerid)==PLAYER_STATE_DRIVER)SetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
else SetPlayerPos(playerid,x,y,z);
i don't understand :/ where i must put this?
Reply
#4

under your /teleport command use :

Код:
if(IsPlayerInAnyVehicle(playerid)) return SetVehiclePos(GetPlayerVehicleID(playerid),X,Y,Z);
else return SetPlayerPos(playerid,X,Y,Z);
Reply
#5

Quote:
Originally Posted by aircombat
Посмотреть сообщение
under your /teleport command use :

Код:
if(IsPlayerInAnyVehicle(playerid)) return SetVehiclePos(GetPlayerVehicleID(playerid),X,Y,Z);
else return SetPlayerPos(playerid,X,Y,Z);
How can I add and interior for the vehicle teleport?
Reply
#6

Quote:
Originally Posted by aircombat
Посмотреть сообщение
under your /teleport command use :

Код:
if(IsPlayerInAnyVehicle(playerid)) return SetVehiclePos(GetPlayerVehicleID(playerid),X,Y,Z);
else return SetPlayerPos(playerid,X,Y,Z);
Probably not correct.
When the player is passenger this would teleport the whole car...

Quote:
Originally Posted by Panormitis
Посмотреть сообщение
How can I add and interior for the vehicle teleport?
Replace:
pawn Код:
SetPlayerPos(playerid,....);
as:
pawn Код:
SetPlayerInterior(playerid,interior ID);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
    SetVehiclePos(player's vehicle ID,x_coord,y_coord,z_coord);
    LinkVehicleToInterior(player'
s vehicle ID,interior ID);
}
else SetPlayerPos(playerid,x_coord,y_coord,z_coord);
Reply
#7

pawn Код:
LinkVehicleToInterior(vehicleid, interiorid); // This should help ya out
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)