I need vehicle tele - 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: I need vehicle tele (
/showthread.php?tid=396185)
I need vehicle tele -
Morkano - 29.11.2012
Hey guys when player goto any teleport player state drive
Re: I need vehicle tele -
GiamPy. - 29.11.2012
pawn Код:
if(GetPlayerState(playerid) == 2)
{
SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), interior);
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), virtualworld);
}
Re: I need vehicle tele -
iTzZh - 29.11.2012
Honestly, I don't know what you're asking. I'm going to try to help by assuming that you're asking, "How do you teleport a player when he enters the state as a 'driver'?"
Under OnPlayerEnterVehicle create an 'if' statement similar to the one I'll create below.
pawn Код:
if(ispassenger == 0) // This says that he's the driver
{
// Teleport player/vehicle to where ever you want here.
}
Re: I need vehicle tele -
tyler12 - 29.11.2012
pawn Код:
forward public Hooked_SetPlayerPos(playerid,Float:x,Float:y,Float:z);
public Hooked_SetPlayerPos(playerid,Float:x,Float:y,Float:z)
{
if(IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
}
else
{
SetPlayerPos(playerid,x,y,z);
}
}
#define SetPlayerPos Hooked_SetPlayerPos
Use SetPlayerPos normally.