#include <amxmodx> #include <amxmisc> #include <engine> #define PLUGIN "Pi drugich" #define VERSION "1.0" #define AUTHOR "R3X" static const buy_classes[][] = { "func_buyzone", "info_map_parameters" } public plugin_precache(){ register_plugin(PLUGIN, VERSION, AUTHOR); createInfoMapParameters(); } isBuyClass(ent, const szParam[] = ""){ new szClassName[32]; if(szParam[0]) copy(szClassName, 31, szParam); else entity_get_string(ent, EV_SZ_classname, szClassName, 31); for(new i=0;i<sizeof buy_classes;i++){ if(equal(buy_classes[i], szClassName)){ if(is_valid_ent(ent)) return true; } } return false; } public pfn_spawn(ent){ if(is_valid_ent(ent) && isBuyClass(ent)) remove_entity(ent); } //Block buying createInfoMapParameters(){ new ent = create_entity("info_map_parameters"); DispatchKeyValue(ent, "buying", "3"); DispatchSpawn(ent); }
Dodalem to do COD'a i wszystko ladnie dziala, tylko ze teraz chcialbym, aby jedna z klas mogla kupowac bronie. Gdzie mam wsadzic warunek?