Raised This Month: $51 Target: $400
 12% 

how to fix m4a1 & usp unsil


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
666
Senior Member
Join Date: Mar 2015
Old 01-15-2018 , 22:02   how to fix m4a1 & usp unsil
Reply With Quote #1

This plugin has the function that when we remove the muffler from the USP or M4A1, it shows the model (p_USP and p_m4a1) of the weapons without the muffler, it works fine but when you have the p_m4a1 o p_usp with without muffler and buy a gun or grenade it shows the muffler of the weapon

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

#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <hamsandwich>

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

const m_pActiveItem 373;

new const 
P_M4[][]     = {"models/p_m4a1_unsil.mdl""models/p_m4a1.mdl"};
new const 
P_USP[][]     = {"models/p_usp_unsil.mdl""models/p_usp.mdl"};

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("CurWeapon""Event_CurWeapon""be","1=1");
    
register_forward(FM_CmdStart"Fw_CmdStart");
}

public 
plugin_precache()
{
    
precache_model(P_M4[0]);
    
precache_model(P_USP[0]);
}

public 
Fw_CmdStart(iduc_handleseed)
{
    if(!
is_user_alive(id))
        return
    
    new 
wpn_id get_user_weapon(id);
    static 
NewButton;
    
NewButton get_uc(uc_handleUC_Buttons);
    
    if(
NewButton IN_ATTACK2)
    
    if(
NewButton IN_ATTACK2)
        if(
wpn_id == CSW_M4A1 || wpn_id == CSW_USP)
            
silencers(idwpn_id);

}

public 
Event_CurWeapon(id)
{
    if(!
is_user_connected(id) || !is_user_alive(id))
        return
    
    new 
wpn_id get_user_weapon(id);
    
    if(
wpn_id == CSW_M4A1 || wpn_id == CSW_USP)
        
silencers(idwpn_id);

}

silencers(idwpn_id)
{
    new 
wpn get_pdata_cbase(idm_pActiveItem);
    static 
model[32];
    
pev(idpev_weaponmodel2model31);
        
    switch(
wpn_id)
    {
        case 
CSW_M4A1:
        {
            if(!
equal(modelP_M4[cs_get_weapon_silen(wpn)]))
                
set_pev(idpev_weaponmodel2P_M4[cs_get_weapon_silen(wpn)]);
            else
                return
        }
        
        case 
CSW_USP:
        {
            if(!
equal(modelP_USP[cs_get_weapon_silen(wpn)]))
                
set_pev(idpev_weaponmodel2P_USP[cs_get_weapon_silen(wpn)]);
            else
                return
        }
    }


666 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 03:02.


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