Hello. I've recently started using this weapon models replacement plugin but I can't seem to manage to make it so only users with ADMIN_LEVEL_A can use the skins. I'm not that familiar with ReAPI and everytime I try I get "Invalid player" errors and stuff. Here's the code.
PHP Code:
#include <amxmodx>
#include <reapi>
#define PLUGIN "[Reapi] Replace Weapon Models"
#define VERSION "1.0"
#define AUTHOR "[N]drs"
#define rg_get_weapon_id(%0) get_member(get_member(get_member(%0, m_pPlayer), m_pActiveItem), m_iId)
new const szV_Model[] = "models/custom/v_usp.mdl"
new const szP_Model[] = "models/custom/p_usp.mdl"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHookChain(RG_CBasePlayerWeapon_DefaultDeploy, "OnPlayerChangeWeapon_Pre", false)
}
public plugin_precache()
{
precache_model(szV_Model)
precache_model(szP_Model)
}
public OnPlayerChangeWeapon_Pre(const iEntity, szViewModel[], szWeaponModel[])
{
switch(rg_get_weapon_id(iEntity))
{
case CSW_USP:
{
SetHookChainArg(2, ATYPE_STRING, szV_Model)
SetHookChainArg(3, ATYPE_STRING, szP_Model)
}
}
return HC_CONTINUE
}
If you guys can help me out, I will be extremely happy. Thanks!