Hew to detect if a player is shooting
#1

Hey guys, I am still working on my mech system and I want to give the player a spray and if he is spraying with it a object will be created on his hand, I know how to do this but I do not know how to detect if he is spraying
Reply
#2

OnPlayerWeaponShot check if weapon id equals spray id then create the object
Reply
#3

Quote:
Originally Posted by lackmail
Посмотреть сообщение
OnPlayerWeaponShot check if weapon id equals spray id then create the object
That's only called for weapons with bullets

Use OnPlayerKeyStateChange and check if player presses KEY_FIRE, to make it a bit more accurate you could also detect if ammo goes down.
Reply
#4

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
That's only called for weapons with bullets

Use OnPlayerKeyStateChange and check if player presses KEY_FIRE, to make it a bit more accurate you could also detect if ammo goes down.
my bad i thought it will work as its given as a weapon i apologies andrei
Reply
#5

OnPlayerWeaponShot will not be called for spray can. You need to check if player's current weapon ID is equal to spray can and then check for animation indexes. Spray can animations Ids : {640, 1160, 1161, 1162, 1163, 1167} to be used with GetPlayerAnimationIndex.
Reply
#6

Thanks everyone, no problem lackmail
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)