cvar.sma(74) : error 048: array dimensions do not match
cvar.sma(78) : error 048: array dimensions do not match
cvar.sma(127) : error 035: argument type mismatch (argument 1)
- | Afiseaza codul
#include <amxmodx> #include <amxmisc> #define START_TIME 22 #define END_TIME 23 new bool:block_cvars; new const cvars_blocked[][] = { "rcon_password", "amx_show_activity", "amx_mode", "amx_password_field", "amx_default_access", "amx_reserved_slots", "amx_reservation", "amx_conmotd_file", "add", "sv_password" } new const temporar_cvars[][] = { "mp_autoteambalance", "sv_unlag" // asta il tin de test } public plugin_init() { register_plugin("Cvar", "1.0", "cyby") register_dictionary("admincmd.txt") register_dictionary("common.txt") check_time() set_task(60.0, "check_time", _, _, _, "b") register_concmd("amx_cvar", "cmdCvar", ADMIN_CVAR, "<cvar> [value]") } public check_time() { new o; time(o, _, _) if(o <= START_TIME || o < END_TIME) { if(!block_cvars) server_cmd("comanda") block_cvars = true } else { if(block_cvars) server_cmd("comanda") block_cvars = false } } public cmdCvar(id, level, cid) { if (!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED new arg[32], arg2[64], cvar_blocat = 0, cvar_temporar = 0; read_argv(1, arg, 31) read_argv(2, arg2, 63) if (!cvar_exists(arg)) { console_print(id, "[AMXX] %L", id, "UNKNOWN_CVAR", arg) return PLUGIN_HANDLED } for(new i; i < sizeof cvars_blocked; i++) if(equal(arg, cvars_blocked)) // 74 cvar_blocat = 1; for(new i; i < sizeof temporar_cvars; i++) if(equal(arg, temporar_cvars)) // 78 cvar_temporar = 1; if(cvar_blocat) { console_print(id, "[AMXX] Nu ai voie sa folosesti comanda asta.") return PLUGIN_HANDLED; } if(cvar_temporar && block_cvars) { console_print(id, "[AMXX] Acest cvar il poti schimba doar intre orele %d si %d.", START_TIME, END_TIME) return PLUGIN_HANDLED; } if (read_argc() < 3) { if(cvar_blocat) { console_print(id, "[AMXX] Nu ai voie sa vezi valoarea comenzii asteia.") return PLUGIN_HANDLED; } get_cvar_string(arg, arg2, 63) console_print(id, "[AMXX] %L", id, "CVAR_IS", arg, arg2) return PLUGIN_HANDLED } new authid[32], name[32] get_user_authid(id, authid, 31) get_user_name(id, name, 31) log_amx("Cmd: ^"%s<%d><%s><>^" set cvar (name ^"%s^") (value ^"%s^")", name, get_user_userid(id), authid, arg, arg2) set_cvar_string(arg, arg2) new activity = get_cvar_num("amx_show_activity") if (activity != 0) { new players[32], pnum, admin[64], len; get_players(players, pnum, "c") for (new i = 0; i < pnum; i++) { len = format(admin, 255, "%L", players, "ADMIN") if (activity == 1) len += copy(admin[len], 255-len, ":") else len += format(admin[len], 255-len, " %s:", name) chat_color(players,"%L", players, "SET_CVAR_TO", name, arg, arg2) } } console_print(id, "[AMXX] %L", id, "CVAR_CHANGED", arg, arg2) return PLUGIN_HANDLED } stock chat_color(const id, const input[], any:...) { new count = 1, players[32] static msg[191] vformat(msg, 190, input, 3) replace_all(msg, 190, "!g", "^4") replace_all(msg, 190, "!y", "^1") replace_all(msg, 190, "!team", "^3") if (id) players[0] = id; else get_players(players, count, "ch") { for (new i = 0; i < count; i++) { if (is_user_connected(players)) { message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players) write_byte(players); write_string(msg); message_end(); } } } }