Help with teleporting in vehicle - 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: Help with teleporting in vehicle (
/showthread.php?tid=271138)
Help with teleporting in vehicle -
Azzeto - 23.07.2011
pawn Код:
CMD:sfdrift(playerid,params[])
{
SetPlayerPos(playerid,-1265.1564,-529.1177,13.8084);
}
else
{
SetVehiclePos(playerid,-1265.1564,-529.1177,13.8084);
}
I want to make it so if the player is on foot, they can teleport there, but if they're in a vehicle they'll also be teleported there with the vehicle, please give me the correct way to put this.
Re: Help with teleporting in vehicle -
Kitten - 23.07.2011
Search ,
https://sampforum.blast.hk/showthread.php?tid=195753
Re: Help with teleporting in vehicle -
Azzeto - 23.07.2011
@Kitten Thank you, I'll search first next time.
Re: Help with teleporting in vehicle -
System64 - 23.07.2011
i think that this function is better and easier
just use SetPlayerPosWithVehicle(playerid, X, Y, Z);
pawn Код:
stock SetPlayerPosWithVehicle(playerid, Float:X, Float:Y, Float:Z)
{
new cartype = GetPlayerVehicleID(playerid);
SetPlayerPos(playerid, X, Y, Z);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
LinkVehicleToInterior(cartype, GetPlayerInterior(playerid));
SetVehiclePos(cartype,X,Y,Z);
PutPlayerInVehicle(playerid,cartype,0);
}
}
Re: Help with teleporting in vehicle -
Azzeto - 23.07.2011
Thank you so much System 64, this works VERY well!