27.10.2018, 18:39
pawn Код:
SetPlayerOrVehiclePos(playerid, Float:x, Float:y, Float:z) //A function to teleport a player checking if he's on foot or in a vehicle
{
if(IsPlayerInAnyVehicle(playerid)) //If player is in a vehicle
{
SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z); //Teleport vehicle(will also teleport the player alongside)
}
else //If he isn't in a vehicle
{
SetPlayerPos(playerid, x, y, z); //Teleport him alone
}
return true;
}