SA-MP Forums Archive
need vehicle 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: need vehicle teleport (/showthread.php?tid=148355)



need vehicle teleport - Kar - 16.05.2010

need tele that can tele vehicle + player... pls help ive been trying for 4 days now


Re: need vehicle teleport - [HiC]TheKiller - 16.05.2010

Look in Useful functions topic, there is a function called SetPlayerPosEx or something.


Re: need vehicle teleport - Kar - 16.05.2010

?? i mean i need a tele that can tele vehicles to and not players only...


Re: need vehicle teleport - juice.j - 16.05.2010

https://sampwiki.blast.hk/wiki/SetVehiclePos


Re: need vehicle teleport - Niixie - 16.05.2010

First get the players vehicle id.
Код:
new pvehicleid = GetPlayerVehicleID(playerid);
Then use SetPlayerPos
Код:
SetPlayerPos(playerid, Float:x, Float:y, Float:z);
After that use SetVehiclePos
Код:
SetVehiclePos(vehicleid, Float:x, Float:y, Float:z);
( Here the vehicleid is defined as pvehicleid, so its the right vehicle you're moving )

After that, use SetVehicleZAngle
Код:
SetVehicleZAngle(vehicleid, Float:a);
( Again the vehicleid is pvehicleid for the right vehicle )

For the final, use PutPlayerInVehicle
Код:
PutPlayerInVehicle(playerid, vehicleid, seatid);
( vehicleid is pvehicleid again, seatid is 0 for driver state )

Hope it helps

Greets
Niixie


Re: need vehicle teleport - Kar - 16.05.2010

whats the players vehicle id?

cant u just give me the whole code<.< i'll fail at bracketing..


Re: need vehicle teleport - Niixie - 17.05.2010

pawn Код:
{
new pvehicleid = GetPlayerVehicleID(playerid);
SetPlayerPos(playerid, x, y, z); // You change the X, Y, Z with what you want
SetVehiclePos(pvehicleid, x, y, z); // You change the X, Y, Z with what you want
SetVehicleZAngle(pvehicleid, a); // You change the A with what you want
PutPlayerInVehicle(playerid, pvehicleid, 0); // This makes him the driver
}