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

Quote:
Originally Posted by Joe_
Посмотреть сообщение
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.
}
}
There is a way to make it but u will have to do it with bigger and smaller vehicles.
For example

pawn Код:
new Float:X, Float:Y, Float:Z;
for(new a = 0; a < MAX_VEHICLES; a++)
{
GetVehiclePos(a, X, Y, Z);
if(IsPlayerInRangeOfPoint(a, 1.0, X+5, Y, Z))
{
//he is near vehicleid a.
}
}
Now you need to be a bit away from the vehicle, place it at the trunk and it's done, the problem is not all vehicles are the same that means you have to make it for bigger and smaller vehicles.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)