Jak zrobic natyw do wlaczania/wylaczania modeli w innym pluginie?
Mam plugin ma modele dla vipa z mozliwoscia wylaczenia/wlaczanie modeli w oddzielnym pluginie i chce zrobic zeby bylo mozna poprzez menu wylaczyc modele (menu mam w silniku serwera)
#include <amxmodx> #include <cstrike> #include <engine> #include <colorchat> #define FLAGA ADMIN_LEVEL_H new bool:modele[33]; public plugin_init(){ register_plugin("Plugin", "0.1", "mucek181") register_event("CurWeapon","CurWeapon","be","1=1"); register_clcmd("say /modele", "m") } public client_authorized(id){ modele[id] = true; } public m(id){ if(!(get_user_flags(id) & FLAGA)){ ColorChat(id, GREEN, "[DD2]^x01 Nie posiadasz^x03 VIP'a") return; } ColorChat(id, GREEN, "^x04Modele:^x03 %s", modele[id] ? "wylaczone" : "wlaczone") modele[id] = !modele[id] } public plugin_precache(){ precache_model("models/DD2/v_ak47.mdl"); precache_model("models/DD2/v_awp.mdl"); precache_model("models/DD2/v_m4a1.mdl"); precache_model("models/DD2/v_deagle.mdl"); precache_model("models/DD2/v_knife.mdl"); precache_model("models/DD2/v_usp.mdl"); precache_model("models/DD2/v_glock18.mdl"); precache_model("models/DD2/v_famas.mdl"); precache_model("models/DD2/v_galil.mdl"); } public CurWeapon(id) { if(!is_user_alive(id)){ return 0 } if(!modele[id]){ return 0 } new weapon = read_data(2); if(weapon == CSW_AK47 && (get_user_flags(id) & FLAGA)) { entity_set_string(id, EV_SZ_viewmodel, "models/DD2/v_ak47.mdl") } if(weapon == CSW_AWP && (get_user_flags(id) & FLAGA)) { entity_set_string(id, EV_SZ_viewmodel, "models/DD2/v_awp.mdl") } if(weapon == CSW_M4A1 && (get_user_flags(id) & FLAGA)) { entity_set_string(id, EV_SZ_viewmodel, "models/DD2/v_m4a1.mdl") } if(weapon == CSW_DEAGLE && (get_user_flags(id) & FLAGA)) { entity_set_string(id, EV_SZ_viewmodel, "models/DD2/v_deagle.mdl") } if(weapon == CSW_KNIFE && (get_user_flags(id) & FLAGA)) { entity_set_string(id, EV_SZ_viewmodel, "models/DD2/v_knife.mdl") } if(weapon == CSW_USP && (get_user_flags(id) & FLAGA)) { entity_set_string(id, EV_SZ_viewmodel, "models/DD2/v_usp.mdl") } if(weapon == CSW_GLOCK18 && (get_user_flags(id) & FLAGA)) { entity_set_string(id, EV_SZ_viewmodel, "models/DD2/v_glock18.mdl") } if(weapon == CSW_FAMAS && (get_user_flags(id) & FLAGA)) { entity_set_string(id, EV_SZ_viewmodel, "models/DD2/v_famas.mdl") } if(weapon == CSW_GALIL && (get_user_flags(id) & FLAGA)) { entity_set_string(id, EV_SZ_viewmodel, "models/DD2/v_galil.mdl") } }