Raised This Month: $32 Target: $400
 8% 

help this plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tarkan00
Senior Member
Join Date: Jan 2017
Old 05-26-2017 , 15:30   help this plugin
Reply With Quote #1

Hello guys, I need simple edit this plugin;
I want your add more 2 weapon in this plugin
example: SG552 and AWP
PHP Code:
#include <amxmodx> 
#include <engine>
#include <fakemeta>
#include <cstrike>

new const zoom[] = "models/v_sight.mdl";
new const 
aug[] = "models/v_aug.mdl";

new 
g_hasZoom[32];
new 
bool:norecoil[33];
new 
szClipszAmmocwz_norecoil;

public 
plugin_precache( )
{
    
precache_model(zoom);
    
precache_model(aug);
}

public 
Event_CurWeapon(id)
{
    if(!
is_user_alive(id) || !is_user_connected(id)) 
        return 
PLUGIN_CONTINUE
    
    
new szWeapID get_user_weaponidszClipszAmmo )
    if(
szWeapID == CSW_AUG && !g_hasZoom[id] == true )
    {
        
entity_set_string(idEV_SZ_viewmodelaug)
    }
    
    return 
PLUGIN_CONTINUE
}

public 
fw_CmdStartiduc_handleseed )
{
    if(!
is_user_alive(id) ) 
    {
        
ZoomFalse(id)
        return 
PLUGIN_HANDLED
    
}
    
    new 
szWeapID get_user_weaponidszClipszAmmo )
    
    if((
get_ucuc_handleUC_Buttons ) & IN_ATTACK2 ) && !( pevidpev_oldbuttons ) & IN_ATTACK2 ) )
    { 
        if(
szWeapID == CSW_AUG && !g_hasZoom[id] == true)
        {
            
ZoomTrue(id)
        }
        
        else if(
szWeapID == CSW_AUG && g_hasZoom[id])
        {
            
ZoomFalse(id)
            
entity_set_string(idEV_SZ_viewmodelaug)
        }
    }
    
    if(
g_hasZoom[id] && ( ( get_ucuc_handleUC_Buttons ) & IN_RELOAD ) && (pev(idpev_button) & IN_RELOAD)) )
    {
        if(
szWeapID == CSW_AUG )
        {
            
ZoomFalse(id)
            
entity_set_string(idEV_SZ_viewmodelaug)
        } 
    }
    if( 
szWeapID != CSW_AUG && g_hasZoom[id] )
    {
        
ZoomFalse(id)
    }
    if(
szClip == && g_hasZoom[id])
    {
        
ZoomFalse(id)
    }
    return 
PLUGIN_HANDLED
}

public 
fw_Player_PreThink(id)
{
    if(!
is_user_alive(id) || get_user_weapon(id) != CSW_AUG)
    {
        return 
FMRES_IGNORED;
    }
    
set_pev(idpev_buttonpev(id,pev_button) & ~IN_ATTACK2
    return 
FMRES_HANDLED;
}

public 
fw_PreThink(id)
{
    if(!
is_user_alive(id) || norecoil[id] == false)
    {
        return 
FMRES_IGNORED;
    }
    
set_pev(id,pev_punchangle,{0.0,0.0,0.0});
    return 
FMRES_HANDLED;
}

public 
fw_Update(idsendweaponscd_handle

    if(!
is_user_alive(id) || norecoil[id] == false)
    {
        return 
FMRES_IGNORED;
    }
    
    
set_cd(cd_handleCD_PunchAngle, {0.0,0.0,0.0})        
    return 
FMRES_HANDLED 
}

public 
ZoomTrue(id)
{
    if(
get_pcvar_num(cwz_norecoil) == 1)
    {
        
norecoil[id] = true
    
}
    
g_hasZoom[id] = true
    entity_set_string
(idEV_SZ_viewmodelzoom
    
cs_set_user_zoom(idCS_SET_AUGSG552_ZOOM0)
    
client_cmd(id"spk weapons/zoom")
}

public 
ZoomFalse(id)
{
    
norecoil[id] = false;
    
g_hasZoom[id] = false
    cs_set_user_zoom
(idCS_RESET_ZOOM0)
}
public 
plugin_init( )
{    
    
register_event("CurWeapon""Event_CurWeapon""be""1=1")
    
register_forward(FM_CmdStart"fw_CmdStart" )
    
register_forward(FM_PlayerPreThink,"fw_Player_PreThink")
    
register_forward(FM_PlayerPreThink,"fw_PreThink")
    
register_forward(FM_UpdateClientData,"fw_Update",1)
    
cwz_norecoil register_cvar("sekmeme_aktifligi""1")

I thanks for your helps

Last edited by tarkan00; 05-26-2017 at 15:30.
tarkan00 is offline
tarkan00
Senior Member
Join Date: Jan 2017
Old 05-29-2017 , 09:00   Re: help this plugin
Reply With Quote #2

up
tarkan00 is offline
Reply


Thread Tools
Display Modes

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 22:08.


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