Puteti sa adaugati in acest plugin si cvarul:
Problema este ca atuni cand cumpar din shop boss/survivor nu imi ia banii.register_native("zp_cs_get_user_money", "get_user_money", 1)
- | Afiseaza codul
#include <amxmodx> #include <zombieplague> #include <money> #define PLUGIN "BOSS/SURV" #define VERSION "2.0" #define AUTHOR "Author" new g_msgSayText new boss, survivor new g_bought[33], bought new cvar_n_price, cvar_s_price, cvar_limit_all, cvar_everytime, cvar_show_bought, cvar_allow_times public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) // Cvar's cvar_everytime = register_cvar("zp_allow_buy", "2") cvar_allow_times = register_cvar("zp_allow_times", "2") cvar_limit_all = register_cvar("zp_limit_for_all", "1") cvar_n_price = register_cvar("zp_boss_ammo_price", "35") cvar_s_price = register_cvar("zp_survivor_ammo_price", "35") cvar_show_bought = register_cvar("zp_show_who_bought", "1") g_msgSayText = get_user_msgid("SayText") // Extra items boss = zp_register_extra_item("Buy Boss", get_pcvar_num(cvar_n_price), 0) survivor = zp_register_extra_item("Buy Survivor", get_pcvar_num(cvar_s_price), 0) } public zp_round_ended() { bought = false } public zp_extra_item_selected(id, itemid) { new value = get_pcvar_num(cvar_everytime) if(itemid == boss) { if(get_pcvar_num(cvar_limit_all) && bought) { client_printcolor(id, "/g[ILGZ] This is no more avaible in this round. Try next round.") return PLUGIN_HANDLED } if(g_bought[id] >= get_pcvar_num(cvar_allow_times)) { client_printcolor(id, "/g[ILGZ] You can't buy it more than %d times.", get_pcvar_num(cvar_allow_times)) return PLUGIN_HANDLED } if(value == 2) { zp_make_user_nemesis(id) new name[64] get_user_name(id, name, 63) client_printcolor(0, "/g[ILGZ] %s /ybought boss!", name) g_bought[id]++ } else if(zp_has_round_started() == value) { zp_make_user_nemesis(id) if(get_pcvar_num(cvar_show_bought)) { new name[64] get_user_name(id, name, 63) client_printcolor(0, "/g[ILGZ] %s /ybought boss!", name) g_bought[id]++ bought = true } } else { client_printcolor(id, "/g[ILGZ] /yYou can buy boss only when %s.", value ? "round started":"round not started") return PLUGIN_HANDLED } } else if(itemid == survivor) { if(get_pcvar_num(cvar_limit_all) && bought) { client_printcolor(id, "/g[ILGZ] This is no more avaible in this round. Try next round.") return PLUGIN_HANDLED } if(g_bought[id] >= get_pcvar_num(cvar_allow_times)) { client_printcolor(id, "/g[ILGZ] You can't buy it more than %d times.", get_pcvar_num(cvar_allow_times)) return PLUGIN_HANDLED } if(value == 2) { zp_make_user_survivor(id) new name[64] get_user_name(id, name, 63) client_printcolor(0, "/g[ILGZ] %s /ybought survivor", name) g_bought[id]++ } else if(zp_has_round_started() == value) { zp_make_user_survivor(id) if(get_pcvar_num(cvar_show_bought)) { new name[64] get_user_name(id, name, 63) client_printcolor(0, "/g[ILGZ] %s /ybought survivor", name) g_bought[id]++ bought = true } } else { client_printcolor(id, "/g[ILGZ] /yYou can buy Survivor only when %s.", value ? "round started":"round not started") return PLUGIN_HANDLED } } return 1 } stock client_printcolor(const id, const input[], any:...) { new iCount = 1, iPlayers[32] static szMsg[191] vformat(szMsg, charsmax(szMsg), input, 3) replace_all(szMsg, 190, "/g", "^4") // green txt replace_all(szMsg, 190, "/y", "^1") // orange txt replace_all(szMsg, 190, "/ctr", "^3") // team txt replace_all(szMsg, 190, "/w", "^0") // team txt if(id) iPlayers[0] = id else get_players(iPlayers, iCount, "ch") for (new i = 0; i < iCount; i++) { if (is_user_connected(iPlayers)) { message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayers) write_byte(iPlayers) write_string(szMsg) message_end() } } }