View Single Post
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-30-2011 , 07:02   Re: [REQ] CSS DM Auto Silencer
Reply With Quote #10

Quote:
Originally Posted by ougogo View Post
It doesn't work with new version of orangebox and CSS, can you update this script?


Cordially,

Hugo
This work on latest Cs:s.
You could check your SM logs have you any errors.

Or tell us what other mods you have on server

*edit


This use extension SDKHooks
PHP Code:
/*
    AutoSilencer by meng
        Automatically puts a silencer on the M4A1.
*/

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

public OnPluginStart()
{
    for(new 
1MaxClientsi++)
    {
        if(
IsClientInGame(i))
        {
            
OnClientPutInServer(i);
        }
    }
}

public 
OnClientPutInServer(client)
{
    
SDKHook(clientSDKHook_WeaponEquipHook_OnWeaponEquip);
}

public 
Action:Hook_OnWeaponEquip(clientweapon)
{
    
decl String:item[20]; item[0] = '\0';
    
GetEdictClassname(weaponitemsizeof(item));

    if (
StrEqual(item"weapon_m4a1")){
        
SetEntProp(weaponProp_Send"m_bSilencerOn"1);
        
SetEntProp(weaponProp_Send"m_weaponMode"1);
    }

*edit
I change SDKHook type SDKHook_WeaponSwitch to SDKHook_WeaponEquip


*update
Thanks zylius and asherk #19
Attached Files
File Type: sp Get Plugin or Get Source (AutoSilencer.sp - 1408 views - 708 Bytes)
File Type: smx AutoSilencer.smx (2.4 KB, 465 views)

Last edited by Bacardi; 09-22-2011 at 07:51.
Bacardi is offline