How to detect in someone is shooting?
#1

How do i detect if someone is shooting a gun?
Reply
#2

As far as I know, this is not possible with any SA:MP function. You can check if the player is holding a gun with GetPlayerWeaponData, but not if he is shooting.
Reply
#3

GetPlayerKeys
Reply
#4

Quote:
Originally Posted by Jochemd
Посмотреть сообщение
As far as I know, this is not possible with any SA:MP function.
Nope but creating an function like this is pretty simple.

Look here to see what i mean:

http://forum.sa-mp.com/showthread.ph...ing#post846212
Reply
#5

is it possible to use it with OnPlayerKeyStateChange? Like if press the fire button it will do what i want it to do?
Reply
#6

pawn Код:
if(HOLDING(KEY_FIRE))
{
     if(!IsPlayerShooting(playerid)) return 0;
     // Do shit if player is shooting.
}
Reply
#7

Thanks, appreciate the help.
One more thing how do i define HOLDING?
Reply
#8

Quote:
Originally Posted by Marshall_Banks
Посмотреть сообщение
Thanks, appreciate the help.
One more thing how do i define HOLDING?
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange Describes it pretty well.
Reply


Forum Jump:


Users browsing this thread: 8 Guest(s)