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 szClip, szAmmo, cwz_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_weapon( id, szClip, szAmmo )
if(szWeapID == CSW_AUG && !g_hasZoom[id] == true )
{
entity_set_string(id, EV_SZ_viewmodel, aug)
}
return PLUGIN_CONTINUE
}
public fw_CmdStart( id, uc_handle, seed )
{
if(!is_user_alive(id) )
{
ZoomFalse(id)
return PLUGIN_HANDLED
}
new szWeapID = get_user_weapon( id, szClip, szAmmo )
if((get_uc( uc_handle, UC_Buttons ) & IN_ATTACK2 ) && !( pev( id, pev_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(id, EV_SZ_viewmodel, aug)
}
}
if(g_hasZoom[id] && ( ( get_uc( uc_handle, UC_Buttons ) & IN_RELOAD ) && (pev(id, pev_button) & IN_RELOAD)) )
{
if(szWeapID == CSW_AUG )
{
ZoomFalse(id)
entity_set_string(id, EV_SZ_viewmodel, aug)
}
}
if( szWeapID != CSW_AUG && g_hasZoom[id] )
{
ZoomFalse(id)
}
if(szClip == 0 && 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(id, pev_button, pev(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(id, sendweapons, cd_handle)
{
if(!is_user_alive(id) || norecoil[id] == false)
{
return FMRES_IGNORED;
}
set_cd(cd_handle, CD_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(id, EV_SZ_viewmodel, zoom)
cs_set_user_zoom(id, CS_SET_AUGSG552_ZOOM, 0)
client_cmd(id, "spk weapons/zoom")
}
public ZoomFalse(id)
{
norecoil[id] = false;
g_hasZoom[id] = false
cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
}
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