[CS:GO] Force shoot & reload
I'm trying to make a function that forces the player to shoot 1 bullet and then reload his weapon.
Basically, the equivalent of "+attack;-attack;+reload;-reload". Using "FakeClientCommand" doesn't seem to work with '+' commands. Using "ClientCommand" outputs "FCVAR_SERVER_CAN_EXECUTE prevented server running command" - can I disable this protection? Any other methods for doing this consistently? |
Re: [CS:GO] Force shoot & reload
Use OnPlayerRunCmd buttons.
buttons =| IN_ATTACK buttons =| IN_RELOAD return Plugin_Changed when you apply button changes. |
Re: [CS:GO] Force shoot & reload
Any idea why this doesn't work? The message isn't printed either.
Code:
Alternatively, can I somehow force the weapon's reload animation to play? |
Re: [CS:GO] Force shoot & reload
For the animation you can try to crate & fire this event
https://wiki.alliedmods.net/Counter-...#weapon_reload |
Re: [CS:GO] Force shoot & reload
Code:
I'm getting the error message. What am I doing wrong? Is there no function that can trigger a model's animation? |
Re: [CS:GO] Force shoot & reload
Idea:
1. In OnPlayerRunCmd, make the player attack when needed. In OnPlayerRunCmdPost make a variable that sees when the next shot can be fired. You cannot reload while unable to fire due to firing too recently. 2. Wait in OnPlayerRunCmd until you can fire again, then force IN_RELOAD. |
Re: [CS:GO] Force shoot & reload
I think you can't do RELOAD and FIRE at the same time.
If u gonna do buttons |= IN_RELOAD you should also do buttons &= ~IN_ATTACK |
Re: [CS:GO] Force shoot & reload
Thank you! This worked. One last problem remains though.
When the player shoots, there is no gunfire sound and no bullet hole is created, even though players do take damage. Code:
|
Re: [CS:GO] Force shoot & reload
Quote:
|
Re: [CS:GO] Force shoot & reload
That made it shoot out more bullets, but still no sound and visual effect.
Code:
|
All times are GMT -4. The time now is 03:48. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.