Yes, easy, but i'm begginer, i don't understand, i have 2 method to change model, and if can, please help me to change sequence. Thanks.
Use ham but not happen
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "Weapon change model"
#define VERSION "1.0"
#define AUTHOR "ils"
new ak47red_P_MODEL[64] = "models/p_sub.mdl"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Item_Deploy, "weapon_ak47", "HamF_Item_Deploy_Post",1)
}
public plugin_precache()
{
precache_model(ak47red_P_MODEL)
}
public HamF_Item_Deploy_Post( entity )
{
const m_pPlayer = 41;
static id
id = get_pdata_cbase(entity, m_pPlayer, 4)
set_pev(id, pev_weaponmodel2, ak47red_P_MODEL);
set_pev(entity, pev_sequence,1)
}
Use fakemeta but not happen
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "Weapon change model"
#define VERSION "1.0"
#define AUTHOR "ils"
new ak47red_P_MODEL[64] = "models/p_sub.mdl"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("CurWeapon","checkWeapon","be","1=1")
}
public plugin_precache()
{
precache_model(ak47red_P_MODEL)
}
public checkWeapon(id)
{
new plrClip, plrAmmo
new plrWeapId
plrWeapId = get_user_weapon(id, plrClip , plrAmmo)
if (plrWeapId == CSW_AK47)
{
checkModel(id)
}
else
{
return PLUGIN_CONTINUE
}
return PLUGIN_HANDLED
}
public checkModel(id)
{
if ( !is_user_alive(id) )
return PLUGIN_CONTINUE;
new szWeapID = read_data(2)
if ( szWeapID == CSW_AK47 )
{
new iWpn=get_pdata_cbase(id, 373, 4) //hamsandwich
set_pev(iWpn, pev_sequence,1)
set_pev(id, pev_weaponmodel2, ak47red_P_MODEL)
}
return PLUGIN_HANDLED
}
__________________