AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   block special attack2 [solved] (https://forums.alliedmods.net/showthread.php?t=61418)

kp_uparrow 09-30-2007 00:05

block special attack2 [solved]
 
how can i block the special attack button that changes the mode of the weapon like semi automatic burst mode...... silencer on off?

ConnorMcLeod 09-30-2007 05:24

Re: block special attack
 
Check what you want, then put this command :

Code:
set_pev( id , pev_button , pev( id , pev_button ) & ~IN_ATTACK2 )

l33tnewb 09-30-2007 05:26

Re: block special attack
 
i think he means _special or the special console command

kp_uparrow 09-30-2007 12:19

Re: block special attack
 
no i mean +attack2, ill try the code

l33tnewb 09-30-2007 12:24

Re: block special attack
 
oh should have sed attack2

kp_uparrow 09-30-2007 18:27

Re: block special attack
 
lol, the code works, just the little text and animation shows up before its canceld because of lag

potatis_invalido 10-01-2007 05:11

Re: block special attack
 
Quote:

Originally Posted by kp_uparrow (Post 537325)
the little text and animation shows up

Code:


public plugin_init()
{
 register_forward(FM_UpdateClientData, "forward_updateclientdata", 1);
}
 
public forward_updateclientdata(id, sendweapons, cd_handle)
{
 if(!is_user_alive(id))
  return FMRES_IGNORED;
 new const weapon = get_user_weapon(id);
 
 if(weapon == CSW_AUG || weapon == CSW_GLOCK18 || weapon == CSW_M4A1 || weapon == CSW_USP || weapon == CSW_FAMAS || weapon == CSW_SG552) // || weapon == CSW_KNIFE
 {
  new const button = pev(id, pev_button);
  if(button & IN_ATTACK2 && !(button & IN_ATTACK))
  set_cd(cd_handle, CD_flNextAttack, halflife_time() + 0.01);
  return FMRES_HANDLED;
 }
 return FMRES_IGNORED;
}



All times are GMT -4. The time now is 07:57.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.