View Single Post
eyal282
Veteran Member
Join Date: Aug 2011
Old 12-17-2020 , 09:04   Re: [CS:GO] Force shoot & reload
Reply With Quote #9

Quote:
Originally Posted by OciXCrom View Post
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:
public Action Cmd_TestShoot(int id, int iArgs) {     g_bForceShoot = true     return Plugin_Handled } public Action OnPlayerRunCmd(id, &iButtons) {     if(g_bForceShoot)     {         PrintToChat(id, "Force shoot")         g_bForceShoot = false         iButtons &= ~IN_RELOAD         iButtons |= IN_ATTACK         g_bCheckNextShot = true         return Plugin_Changed     }     else if(g_bForceReload && GetGameTime() >= g_fDoReload)     {         PrintToChat(id, "Force reload")         g_bForceReload = false         iButtons &= ~IN_ATTACK         iButtons |= IN_RELOAD         return Plugin_Changed     }     return Plugin_Continue } public void OnPlayerRunCmdPost(id, iButtons) {     if(g_bCheckNextShot)     {         g_bForceReload = true         g_bCheckNextShot = false         g_fDoReload = GetEntPropFloat(GetEntPropEnt(id, Prop_Send, "m_hActiveWeapon"), Prop_Send, "m_flNextPrimaryAttack")         PrintToChat(id, "Next shot in %f", g_fDoReload)     } }
Try making the button pressed for more than one forward fire?
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline