Raised This Month: $ Target: $400
 0% 

m4a1's Silence


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
k1203352
New Member
Join Date: May 2014
Old 05-10-2014 , 11:04   m4a1's Silence
Reply With Quote #1

I want to bind"t" on m4a1's silence.

But i don't want bind"t" with zoom...

How should I do sma?
k1203352 is offline
NikKOo31
Senior Member
Join Date: May 2013
Location: Home
Old 05-10-2014 , 11:54   Re: m4a1's Silence
Reply With Quote #2

Not sure of sending +attack2, but if you want to test, here you go:

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
//#include <cstrike>
#include <engine>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Add your code here...
    
register_impulse(201"impulse_201"//spray default on t
}

public 
impulse_201(id
{
    new 
weapon get_user_weapon(id__)
    if(
weapon == CSW_M4A1)
    {
        
engclient_cmd(id"+attack2"//not tested D:
    
}

    return 
PLUGIN_CONTINUE

You must have spray bind on T if you want this to work
NikKOo31 is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 05-10-2014 , 19:09   Re: m4a1's Silence
Reply With Quote #3

he wants to put a silencer on an m4a1 without using +attack2(hence the no zoom part)
I have no idea how it's done but I think it can be done, or at least I think so, I've played on DM servers where m4a1 from menu already has a silencer on it depending on how you died holding the gun
aron9forever is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 05-10-2014 , 19:25   Re: m4a1's Silence
Reply With Quote #4

Try cs_set_weapon_silen( )
Backstabnoob is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 05-10-2014 , 20:34   Re: m4a1's Silence
Reply With Quote #5

Nikko's example would be pretty much correct as long as your "T" is bound to "impulse 201". Though you may need to chance engclient_cmd() to client_cmd(). It may also require adding "wait; -attack2". Needs testing.
__________________

Last edited by hleV; 05-10-2014 at 20:36.
hleV is offline
NikKOo31
Senior Member
Join Date: May 2013
Location: Home
Old 05-10-2014 , 22:03   Re: m4a1's Silence
Reply With Quote #6

Quote:
Originally Posted by aron9forever View Post
he wants to put a silencer on an m4a1 without using +attack2(hence the no zoom part)
I have no idea how it's done but I think it can be done, or at least I think so, I've played on DM servers where m4a1 from menu already has a silencer on it depending on how you died holding the gun
I don't think he say that.

Quote:
Originally Posted by hleV View Post
Nikko's example would be pretty much correct as long as your "T" is bound to "impulse 201". Though you may need to chance engclient_cmd() to client_cmd(). It may also require adding "wait; -attack2". Needs testing.
I thought that after posting. I'm not sure if would need delay between +attack2 and -attack2? I will try to test it later
NikKOo31 is offline
k1203352
New Member
Join Date: May 2014
Old 05-11-2014 , 01:00   Re: m4a1's Silence
Reply With Quote #7

Thanks each help.

I want bind " t " on m4a1's silence like this...

PHP Code:
/* UTF-8 func by www.DT-Club.net */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta_util>
#include <hamsandwich>

#define PLUGIN_NAME "New Plug-In"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "Love灬Weiwei"

#define WEAPON_CSW CSW_M4A1
#define WEAPON_ENT "weapon_m4a1"
#define WEAPON_RELOAD_TIME 4.0
#define WEAPON_DRAW_TIME 2.0
#define WEAPON_ADDSIL_TIME 1.8
#define WEAPON_SHOOT_TIME 2.2

#define TASK_SHOOT 1234

enum {
 
anim_idle,
 
anim_reload,
 
anim_draw,
 
anim_shoot1,
 
anim_shoot2,
 
anim_shoot3,
 
anim_add,
 
anim_idle_unsil,
}

new 
g_reloading[33],g_addsil[33],g_shooting[33],g_hasDoneCurWeap[33]

const 
m_pPlayer 41   
const m_flNextPrimaryAttack 46

public plugin_init()
{
 
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR);
 
register_forward(FM_CmdStart"forward_cmdstart")
 
register_forward(FM_UpdateClientData"UpdateClientData_Post"1)
 
 
register_event("CurWeapon","Current_Weapon","be","1=1")
 
 
RegisterHam(Ham_Weapon_PrimaryAttackWEAPON_ENT"fw_WeapPriAttack"1)
 
RegisterHam(Ham_Weapon_ReloadWEAPON_ENT"fw_WeaponReload",1);
 
RegisterHam(Ham_Item_DeployWEAPON_ENT"fw_WeaponDeployPost"1);
 
g_grenade_access register_cvar("amx_grenade_access""p");
 
//
}

public 
native_playanim(player,anim)
{
 
set_pev(playerpev_weaponanimanim)
 
message_begin(MSG_ONESVC_WEAPONANIM, {000}, player)
 
write_byte(anim)
 
write_byte(pev(playerpev_body))
 
message_end()
}


public 
forward_cmdstart(iduc_handleseed)
{
 if(!
is_user_alive(id) || get_user_weapon(id) != WEAPON_CSW)
  return 
PLUGIN_HANDLED
  
 
if((get_uc(uc_handleUC_Buttons) & IN_ATTACK2) && !(pev(idpev_oldbuttons) & IN_ATTACK2) )
 {
  if(!
g_reloading[id] && !g_addsil[id])
  {
   if(
cs_get_user_zoom(id) == CS_SET_AUGSG552_ZOOM)
   {
    
cs_set_user_zoom(id,CS_RESET_ZOOM,1)
   }
   else
   {
    
cs_set_user_zoom(id,CS_SET_AUGSG552_ZOOM,1)
   }
   
   
emit_sound(idCHAN_ITEM"weapons/zoom.wav"0.202.400100)
  }

 }
 

 if( 
get_uc(uc_handleUC_Impulse) ==  201 && !g_reloading[id] && !g_addsil[id] && !g_shooting[id])
 {

  
cs_set_user_zoom(idCS_RESET_ZOOM0)
  
  
remove_task(id)
  
g_addsil[id] = true
  set_task
(WEAPON_ADDSIL_TIME,"Finish_addSil",id)
  
  new 
ent fm_find_ent_by_owner(-1WEAPON_ENT,id)
  
  if(
cs_get_weapon_silen(ent))
  {
   
cs_set_weapon_silen(ent,0,1)
  }
   
  else
  {
   
cs_set_weapon_silen(ent,1,1
  }
    
 }

 new 
cmd
 
 
if(g_addsil[id])
 {
  if((
cmd get_uc(uc_handleUC_Buttons)) & IN_ATTACK )
  {
   
cmd &= ~IN_ATTACK
   set_uc
(uc_handleUC_Buttonscmd)
  }  
  
  if((
cmd get_uc(uc_handleUC_Buttons)) & IN_RELOAD )
  {
   
cmd &= ~IN_RELOAD
   set_uc
(uc_handleUC_Buttonscmd)
  }  
 }
 
 if((
cmd get_uc(uc_handleUC_Buttons)) & IN_ATTACK2 )
 {
  
cmd &= ~IN_ATTACK2
  set_uc
(uc_handleUC_Buttonscmd)
 }
    
 
 return 
PLUGIN_HANDLED
}

public 
Finish_WeapReload(id)
{

 
g_reloading[id] = false
 
}

public 
Finish_addSil(id)
{
 
g_addsil[id] = false
 
 
if(is_user_alive(id) && get_user_weapon(id) == WEAPON_CSW)
 {
  new 
ent fm_find_ent_by_owner(-1WEAPON_ENT,id)
  
  if(
cs_get_weapon_silen(ent))
   
native_playanim(id,anim_idle)
  else
   
native_playanim(id,anim_idle_unsil)
 }
}

public 
Finish_shoot(taskid)
{
 new 
id taskid-TASK_SHOOT
 
 g_shooting
[id] = false
}

public 
Current_Weapon(id)
{
 if(!
g_hasDoneCurWeap[id] && get_user_weapon(id) != WEAPON_CSW)
 {
  
remove_task(id)
  
remove_task(id+TASK_SHOOT)
  
g_reloading[id] = false
  g_addsil
[id] = false
  g_shooting
[id] = false
  g_hasDoneCurWeap
[id] = true
 
}

}

public 
UpdateClientData_Postidsendweaponscd_handle )
{
 if(!
is_user_alive(id) || !g_addsil[id] || get_user_weapon(id) != WEAPON_CSW)
  return 
PLUGIN_HANDLED
 
 set_cd
(cd_handleCD_ID1);
 
 return 
PLUGIN_CONTINUE
}


public 
fw_WeaponReload(weapon)
{
 static 
id;
 
id get_pdata_cbase(weaponm_pPlayer4);
 
 
cs_set_user_zoom(idCS_RESET_ZOOM0
 
 
remove_task(id)
 
g_reloading[id] = true
 set_task
(WEAPON_RELOAD_TIME,"Finish_WeapReload",id)
}

public 
fw_WeaponDeployPost(weapon)
{
 static 
id;
 
id get_pdata_cbase(weaponm_pPlayer4);
 
 
remove_task(id)
 
g_reloading[id] = true
 set_task
(WEAPON_DRAW_TIME,"Finish_WeapReload",id)
 
 
g_hasDoneCurWeap[id] = false
 
 client_print
(id,print_chat,"欢迎使用开镜精华,右键开镜,T键使用特殊功能。")
}

public 
fw_WeapPriAttack(weapon)
{
 static 
id;
 
id get_pdata_cbase(weaponm_pPlayer4);
 
 if(
cs_get_user_zoom(id) == CS_SET_AUGSG552_ZOOM)
 {
  static 
Float:weap_delay
  weap_delay 
get_pdata_float(weapon464) * 1.5
  
  set_pdata_float
(weaponm_flNextPrimaryAttackweap_delay4)
 }
 
 
remove_task(id+TASK_SHOOT)
 
g_shooting[id] = true
 set_task
(WEAPON_SHOOT_TIME,"Finish_shoot",id+TASK_SHOOT)
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\\\ rtf1\\\\ ansi\\\\ deff0{\\\\ fonttbl{\\\\ f0\\\\ fnil\\\\ fcharset134 Tahoma;}}\\n\\\\ viewkind4\\\\ uc1\\\\ pard\\\\ lang2052\\\\ f0\\\\ fs16 \\n\\\\ par }
*/ 
But it's has sight zoom.

I don't want this.

Last edited by k1203352; 05-11-2014 at 01:03.
k1203352 is offline
xairgeo
Member
Join Date: Oct 2014
Old 10-03-2018 , 01:53   Re: m4a1's Silence
Reply With Quote #8

bump
xairgeo is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 10-03-2018 , 07:47   Re: m4a1's Silence
Reply With Quote #9

Quote:
Originally Posted by xairgeo View Post
bump
What the f*, no one will answer you since this thread was been created in 2014.
__________________









Last edited by CrazY.; 10-03-2018 at 07:47.
CrazY. is offline
SHIELD755
Veteran Member
Join Date: Feb 2018
Location: FROM MARVEL STUDIO
Old 10-03-2018 , 11:09   Re: m4a1's Silence
Reply With Quote #10

Quote:
Originally Posted by xairgeo View Post
bump

from where did you get this
__________________
SED LYF !!!
SHIELD755 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:46.


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