OnPlayerSwitchWeapon?
#7

Quote:
Originally Posted by Kaliber
Посмотреть сообщение
Just check OnPlayerKeyStateChange

There you can check if he presses Q and can instant check if the weapon got changed

So you dont need unnecessary checks
The weapon switch keys are not synced, neither OnPlayerKeyStateChange nor GetPlayerKeys will detect them. So this isn't even possible. Also there are multiple ways to switch a weapon so additional checks would be required anyway.

You need to use a timer or something similar for this.
If OnPlayerUpdate is called too often in your opinion, use a timer with a higher interval.
I'd suggest starting with a 500ms timer. If it skips too many weapon changes, lower it until it works as expected.

OnPlayerUpdate is the fastest detection you can do ("fastest" as of reaction time) since it's called everytime the weapon ID gets synced, so you cannot technically check it more often than that (you can check it, but the value won't change until the next update).
Reply


Messages In This Thread
OnPlayerSwitchWeapon? - by Marshas - 22.03.2019, 14:35
Re: OnPlayerSwitchWeapon? - by Bolex_ - 22.03.2019, 14:50
Re: OnPlayerSwitchWeapon? - by Marshas - 22.03.2019, 15:08
Re: OnPlayerSwitchWeapon? - by Kaliber - 22.03.2019, 15:14
Re: OnPlayerSwitchWeapon? - by antixgaming - 22.03.2019, 16:17
Re: OnPlayerSwitchWeapon? - by m4karow - 22.03.2019, 16:34
Re: OnPlayerSwitchWeapon? - by NaS - 22.03.2019, 17:04
Re: OnPlayerSwitchWeapon? - by Marshas - 22.03.2019, 17:15
Re: OnPlayerSwitchWeapon? - by antixgaming - 22.03.2019, 18:16
Re: OnPlayerSwitchWeapon? - by Marshas - 22.03.2019, 20:52
Re: OnPlayerSwitchWeapon? - by antixgaming - 22.03.2019, 21:50
Re: OnPlayerSwitchWeapon? - by Marshas - 23.03.2019, 15:41

Forum Jump:


Users browsing this thread: 1 Guest(s)