[help] teleporting
#1

i was woundering how i can teleport with my car still with me


thx for ur time
Reply
#2

When you are in a vehicle and you teleport the vehicle, you remain inside the vehicle...
pawn Код:
SetVehiclePos(vehicleid, X, Y, Z);
Reply
#3

pawn Код:
if (strcmp("/teleport",cmdtext,true)==0)
    {
    new vehicleid = GetPlayerVehicleID(playerid);
    if(IsPlayerInAnyVehicle(playerid))
    {
    SetVehiclePos(vehicleid,X, Y,Z);
    }
    else {
    SetPlayerPos(playerid,X,Y,Z);
    }
    return 1;
    }
Not tested but it would work, kewl
Reply
#4

Nearly good!

But if you are in a car the car only teleport.
Here:

Код:
if (strcmp("/teleport",cmdtext,true)==0)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    if(IsPlayerInAnyVehicle(playerid))
    {
      SetVehiclePos(vehicleid,X, Y,Z);
      SetPlayerPos(playerid,X,Y,Z);
    }
    else 
    {
      SetPlayerPos(playerid,X,Y,Z);
    }
  return 1;
  }
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)