RSSy MYGO.pl Opublikowano Czerwiec 29, 2023 o 01:59 RSSy Udostępnij Opublikowano Czerwiec 29, 2023 o 01:59 I'm using this method of replacing models with REAPI. It works fine but I would like that only people with the flag ADMIN_IMMUNITY can use the models when they type /guns in chat. Also, is there a way that if the player buys or picks up a shield the model gets set to default? 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} Another question: Is this method (REAPI) better than using Item Deploy in terms of cpu usage and performance? Thanks! Przeczytaj cały wpis Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi