29.04.2012, 17:54
pawn Code:
stock SetPlayerPosEx(playerid, Float:x, Float:y, Float:z, Float:a = -1.0, interior = -1, vw = -1)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid=GetPlayerVehicleID(playerid);
SetVehiclePos(vehicleid,x,y,z);
if(a == -1.0) GetVehicleZAngle(vehicleid, a);
SetVehicleZAngle(vehicleid,a);
if(interior == -1) interior = GetPlayerInterior(playerid);
LinkVehicleToInterior(vehicleid, interior);
if(vw == -1) vw = GetVehicleVirtualWorld(vehicleid);
SetVehicleVirtualWorld(vehicleid, vw);
}
else
{
SetPlayerPos(playerid, x, y, z);
if(a == -1.0) GetPlayerFacingAngle(playerid, a);
SetPlayerFacingAngle(playerid, a);
if(interior == -1) interior = GetPlayerInterior(playerid);
SetPlayerInterior(playerid, interior);
if(vw == -1) vw = GetPlayerVirtualWorld(playerid);
SetPlayerVirtualWorld(playerid, vw);
}
return 1;
}