SA-MP Forums Archive
Is it possible? - 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: Is it possible? (/showthread.php?tid=190111)



Is it possible? - Lars_Frederiksen - 14.11.2010

Can I make it so that if a Cop shoots a player with a SDPistol it tazes them?


Re: Is it possible? - Simon - 14.11.2010

Yes.

Use OnPlayerKeyStateChange to detect when they shoot, use GetPlayerCameraVector to detect where they're looking at, check if any players are in the players view (+check if health was lost and if they're streamed in/distance since you cannot natively detect objects in the way), then do whatever you want to simulate the effect of tazing (e.g. animation or whatever) ..


Re: Is it possible? - Steven82 - 14.11.2010

Quote:
Originally Posted by Simon
Посмотреть сообщение
Yes.

Use OnPlayerKeyStateChange to detect when they shoot, use GetPlayerCameraVector to detect where they're looking at, check if any players are in the players view (+check if health was lost and if they're streamed in/distance since you cannot natively detect objects in the way), then do whatever you want to simulate the effect of tazing (e.g. animation or whatever) ..
And if you don't understand that you can find one in an Released Gamemode somewhere, probabbly Godfather.