07.01.2018, 09:20
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
}