SA-MP Forums Archive
Keeping car when teleport.. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Keeping car when teleport.. (/showthread.php?tid=112118)



Keeping car when teleport.. - DiddyBop - 05.12.2009

Hi i got a prob..

How do you keep the current car your in and teleport?

when i type /trans it just teleports the player.. not the car he in..

An annoying problem on my server.. help pls? will give creds...


Re: Keeping car when teleport.. - Badger(new) - 05.12.2009

You need to add something like this:
pawn Код:
if(IsPlayerInAnyVehicle(playerid))//checks if they are in a vehicle
{
    SetVehiclePos(GetPlayerVehicleID(playerid)/*Gets their vehicle ID*/,X,Y,Z);//sets vehicle position
}
else//if they are not in a vehicle
{
    SetPlayerPos(playerid,X,Y,Z);//sets the player's position
}
##Edited


Re: Keeping car when teleport.. - DiddyBop - 05.12.2009

NVM it works i forgot to delete the other line..

thx badg