How to check if a player is in at the bonnet and the boot of a vehicle - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to check if a player is in at the bonnet and the boot of a vehicle (
/showthread.php?tid=506476)
How to check if a player is in at the bonnet and the boot of a vehicle -
arko123 - 13.04.2014
Hello, how would I check if a player is in at the bonnet and the boot of a vehicle, I have seen other functions made by users but I didn't know if they were outdated forms of doing it. Any help is much appreciated.
Re: How to check if a player is in at the bonnet and the boot of a vehicle -
Mriss - 13.04.2014
Something like this>
pawn Код:
new Float:vehx, Float:vehy, Float:vehz;
GetVehiclePos(/*YOUR, Vehicle ID (e.g GetClosestVehicle stock u can make)*/ vehx, vehy, vehz);
if(IsPlayerInRangeOfPoint(playerid, 3.0, vehx, vehy, vehz))
{
/* Stuff to Open Bonnet */
SendClientMessage(playerid,0xFFFFFFFF,"You have opened the bonnet");
}
else
{
SendClientMessage(playerid,0xFFFFFFFF,"You are not close enough to the car!");
}
Re: How to check if a player is in at the bonnet and the boot of a vehicle -
arko123 - 13.04.2014
Quote:
Originally Posted by Mriss
Something like this>
pawn Код:
new Float:vehx, Float:vehy, Float:vehz; GetVehiclePos(/*YOUR, Vehicle ID (e.g GetClosestVehicle stock u can make)*/ vehx, vehy, vehz); if(IsPlayerInRangeOfPoint(playerid, 3.0, vehx, vehy, vehz)) { /* Stuff to Open Bonnet */ SendClientMessage(playerid,0xFFFFFFFF,"You have opened the bonnet"); } else { SendClientMessage(playerid,0xFFFFFFFF,"You are not close enough to the car!"); }
|
This just checks if a player is near a vehicle, not if a player is near the bonnet/boot a vehicle does it?
Re: How to check if a player is in at the bonnet and the boot of a vehicle -
iZN - 13.04.2014
This include would help you and don't worry, it is efficient.
https://sampforum.blast.hk/showthread.php?tid=486060