Teleport with Vehicle Help - 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)
+--- Thread: Teleport with Vehicle Help (
/showthread.php?tid=325975)
Teleport with Vehicle Help -
Alexy_Dramon - 15.03.2012
Hi guys i stucked with one question i tryed make own but it's working
i trying to make simple Teleport
i mean that when i teleporting so that vehicle where i set in that will teleport me with Vehicle
when i making simeple Teleport
with only
SetPlayerPos(playerid,);
it's teleporting only the character but the vehicle it's aisn't
how i make that it's Teleport my charcater with vehicle that i set inside thanks
Re: Teleport with Vehicle Help -
Unknownich - 15.03.2012
pawn Код:
if(strcmp(cmd, "/teleport", true) == 0)
{
if(GetPlayerState(playerid) == 2)
SetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
else SetPlayerPos(playerid,x,y,z);
return 1;
}
Re: Teleport with Vehicle Help -
Alexy_Dramon - 15.03.2012
Thanks
Re: Teleport with Vehicle Help -
[KHK]Khalid - 16.03.2012
i recommend
pawn Код:
if(IsPlayerInAnyVehicle(playerid))
instead of
pawn Код:
if(GetPlayerState(playerid) == 2)
because if(GetPlayerState(playerid) == 2) teleports the vehicle only if "playerid" is driver on the other hand if(IsPlayerInAnyVehicle(playerid)) does for both (if DRIVER/PASSENGER)