26.06.2012, 15:51
How can I get the position of a fuelcap from this?
Thanks!
pawn Код:
stock TrunkXY(playerid, &Float:x2, &Float:y2, Float:distance)
{
new
Float:a,
Float:z
;
GetPlayerPos(playerid, x2, y2, z);
GetPlayerFacingAngle(playerid, a);
if(GetPlayerVehicleID(playerid))
{
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
}
x2 += (distance * floatsin(-a+180, degrees));
y2 += (distance * floatcos(-a+180, degrees));
SetPlayerCheckpoint(playerid, x2, y2, z, 1.0);
}