SA-MP Forums Archive
[Not Solved] Need help to making something - 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: [Not Solved] Need help to making something (/showthread.php?tid=92098)



[Not Solved] Need help to making something - Ben147 - 18.08.2009

i wanna do that if somebody get hit from deagle he automatic do animation that i chooce..


Re: [Not Solved] Need help to making something - cozza123456 - 18.08.2009

like he dances when buys deagle?


Re: [Not Solved] Need help to making something - Weirdosport - 18.08.2009

There's no way to detect if somebody got hit by a deagle (reliably), apart from when they die (you can check the killerid's weapon). But I don't think you can use animations just after a player has died.


Re: [Not Solved] Need help to making something - Eazy_Efolife - 18.08.2009

Quote:
Originally Posted by cozza123456
like he dances when buys deagle?
read what he wrote again:

Код:
i wanna do that if somebody get hit from deagle he automatic do animation that i chooce..



Re: [Not Solved] Need help to making something - Weirdosport - 18.08.2009

This looks extremely like http://forum.sa-mp.com/index.php?topic=116938.0

I'm thinking timers to detect damage, checking if a player is within a certain distance of you, and whether they're holding a deagle or not. Maybe something to work out if they're facing you or not. It's quite a task if you don't know what you're doing, and fairly server intensive I'd have thought.


Re: [Not Solved] Need help to making something - Sergei - 18.08.2009

You can do that with OnPlayerKeyStateChange.
Detect if player is pressing fire button when he has deagle in active weapon slot. Then make a loop of all players and choose those which are XX away from you. Find how much health one deagle bullet takes and then mix everything together.

On the end you need to get that if you press the fire button with deagle in active weapon slot and someone is less than XX meters away from you and loses YY health (one deagle bullet) that player is target of animation.