29.11.2012, 16:51
Hey guys when player goto any teleport player state drive
if(GetPlayerState(playerid) == 2)
{
SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), interior);
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), virtualworld);
}
if(ispassenger == 0) // This says that he's the driver
{
// Teleport player/vehicle to where ever you want here.
}
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