Teleporting a vehicle with me - 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: Teleporting a vehicle with me (
/showthread.php?tid=269574)
Teleporting a vehicle with me -
cloudysky - 17.07.2011
Hi, I want wondering how I could tp to a certain location and if I was in a vehicle it teleports that to?
Re: Teleporting a vehicle with me -
=WoR=Varth - 17.07.2011
Quote:
Originally Posted by Lee_Percox
|
https://sampforum.blast.hk/showthread.php?tid=269555
Re: Teleporting a vehicle with me -
cloudysky - 17.07.2011
It's not a vehicle with an ID though, it's one I've spawned
Re: Teleporting a vehicle with me -
=WoR=Varth - 17.07.2011
Every car have ID.
This is the simple code:
pawn Код:
CMD:goto(playerid,params[])
{
new toplayerid;
if(sscanf(params,"r ",toplayerid)) return SendClientMessage(playerid,SYellow,"Usage: /goto <playerid/name> ~To teleport to certain player.");
else
{
new Float:Pos[3];
GetPlayerPos(toplayerid,Pos[0],Pos[1],Pos[2]);
if(IsPlayerInAnyVehicle(playerid))
{
new vid = GetPlayerVehicleID(playerid);
SetVehiclePos(vid,Pos[0],Pos[1],Pos[2]);
PutPlayerInVehicle(playerid,vid);
}
else SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
}
return 1;
}