Detecting where a Fire Truck is throwing water - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Detecting where a Fire Truck is throwing water (
/showthread.php?tid=254855)
Detecting where a Fire Truck is throwing water -
o_O - 13.05.2011
Is there actually any sort of way to detect where a vehicle is aiming once it shoots?
I am talking about vehicles like the fire truck or even the tank - which I guess could be pretty much the same, except for the fact that the fire truck just keeps firing while the tank has a certain maximum frequency.
So... any ideas? I'd be fine with just knowing the angles for x,y and z.
Re: Detecting where a Fire Truck is throwing water -
park4bmx - 13.05.2011
I don't know maybe there is a chance.
Well u could get the angle of the player to see which way he is fAcing
[b]GetPlayerFacingAngle[\b]
Re: Detecting where a Fire Truck is throwing water -
__ - 13.05.2011
You could try this:
pawn Код:
#define HOLDING(%0) \
((newkeys & (%0)) == (%0))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
if(HOLDING(KEY_FIRE) && GetVehicleModel(GetPlayerVehicleID(playerid)) == 407) {
new
Float: fAimingCoords[3];
GetPlayerCameraPos(playerid, fAimingCoords[0], fAimingCoords[1], fAimingCoords[2]);
/* the player is aiming at: fAimingCoords[0], fAimingCoords[1], fAimingCoords[2] */
}
return 1;
}
Re: Detecting where a Fire Truck is throwing water -
Vince - 13.05.2011
GetPlayerCameraFrontVector