[HELP] Teleport Vehicles?
#1

Hello,

Is there any way to create a command that will teleport you plus the vehicle? For example, I got my own garage interior with an icon at the garage door, if I drive into the icon and type /exit it should teleport me back to the world.

Thanks for your support!
Reply
#2

of course it is,

here is mine with some explanation:

pawn Код:
if(strcmp(cmdtext, "/stunt1", true)==0) //It is on a command, if you want to do it on a pickup, simply //change all thise strcmp and stuff to if(pickup...)
    {
        new vehicleid=GetPlayerVehicleID(playerid);
        if(vehicleid){
        SetVehiclePos(vehicleid, x,y,z);
                         GameTextForPlayer(playerid," you teleported in a vehicle",5000,3);
        }
        else
        {
        SetPlayerPos(playerid, x,y,z); //If the player is not in a vehicle and he teleports:
        GameTextForPlayer(playerid,"You teleported onfoot",5000,3);
        }
        return 1;
        }
Reply
#3

Or this one..this works.i tested:
Код:
if(!strcmp(cmdtext, "/entrance", true))
        {
        if(IsPlayerInAnyVehicle(playerid))
        {
            SetVehiclePos(GetPlayerVehicleID(playerid), 2857.31,-1960.78,10.9376); //i have my own coordinates but u can change!
            SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
            LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
        }
        else
        {
            SetPlayerPos(playerid, 2857.31,-1960.78,10.9376); //same goes here
            SetPlayerFacingAngle(playerid, 0.0);
        }
        SetPlayerInterior(playerid, 0);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, " Welcome to blah blah!");
        return 1;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)