How to check Is player near vehicle bonnet/boot?
#2

itterate through all vehicles and use IsPlayerInRangeOfPoint to check if the player is near the vehicle. I don't think there is a way to check if he is near part of the vehicle specifically without making an array of offsets for each vehicle which would take forever.

Something like this:

pawn Код:
new Float:X, Float:Y, Float:Z;
for(new a = 0; a < MAX_VEHICLES; a++)
{
GetVehiclePos(a, X, Y, Z);
if(IsPlayerInRangeOfPoint(a, 4.0, X, Y, Z))
{
//he is near vehicleid a.
}
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)