Vehicle's petrolcap pos
#2

This might work:

pawn Код:
new Float: modelX, Float: modelY, Float: modelZ,
    Float: X, Float: Y, Float: Z, Float: R;

GetVehiclePos(vehicleid, X, Y, Z);
GetVehicleZAngle(vehicleid, R);
GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_PETROLCAP, modelX, modelY, modelZ);
                   
Z += modelZ;

X += (modelY * floatsin(-R, degrees));
Y += (modelY * floatcos(-R, degrees));

R += 270.0;
X += (modelX * floatsin(-R, degrees));
Y += (modelX * floatcos(-R, degrees));
R -= 270.0;
                   
if(IsPlayerInRangeOfPoint(playerid, 1.0, X, Y, Z))
{
    // Player is at (or atleast very close to) the petrolcap
}
Reply


Messages In This Thread
Vehicle's petrolcap pos - by zsoolt997 - 07.01.2018, 09:10
Re: Vehicle's petrolcap pos - by Infra - 07.01.2018, 09:20
Re: Vehicle's petrolcap pos - by zsoolt997 - 07.01.2018, 09:50

Forum Jump:


Users browsing this thread: 1 Guest(s)