22.03.2014, 13:39
How is this achieved?
new vehicleid, Float:x, Float:y, Float:z, Float:angle;
vehicleid = GetPlayerVehicleID(playerid);
if(vehicleid)
{
GetVehiclePos(vehicleid, x, y, z);
GetVehicleZAngle(vehicleid, angle);
AttachObjectToVehicle(objectid, vehicleid, fX - x, fY - y, fZ - z, 0.0, 0.0, angle);
}
else
{
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
AttachObjectToPlayer(objectid, playerid, fX - x, fY - y, fZ - z, 0.0, 0.0, angle);
}