Problem to set flags for CVars
Hi,
I wanted to change flags of this plugin
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
public plugin_modules()
{
require_module("fun")
require_module("cstrike")
}
public plugin_init()
{
register_plugin("Godmode", "1.0", "f117bomb")
register_concmd("amx_godmode","admin_godmode",ADMIN_LEVEL_A,"<authid, nick, @team or #userid> <0=OFF 1=ON>")
}
//ADMIN GODEMODE v0.9.3 by f117bomb
//=========================================================
public admin_godmode(id,level,cid) {
if (!cmd_access(id,level,cid,3))
return PLUGIN_HANDLED
new arg[32], arg2[8], name2[32]
read_argv(1,arg,31)
read_argv(2,arg2,7)
get_user_name(id,name2,31)
if (arg[0]=='@'){
new players[32], inum
get_players(players,inum,"ae",arg[1])
if (inum==0){
console_print(id, "%L", LANG_PLAYER, "AINO_NO_CLIENTS")
return PLUGIN_HANDLED
}
for(new a=0;a<inum;++a) {
set_user_godmode(players[a],str_to_num(arg2))
}
switch(get_cvar_num("amx_show_activity")) {
case 2: client_print(0,print_chat, "%L", LANG_PLAYER, "AINO_GODMODE_TEAM_CASE2", name2, arg[1])
case 1: client_print(0,print_chat, "%L", LANG_PLAYER, "AINO_GODMODE_TEAM_CASE1", arg[1])
}
console_print(id, "%L", LANG_PLAYER, "AINO_GODMODE_ALL_SUCCESS")
log_amx("%L", LANG_SERVER, "AINO_LOG_GODMODE_ALL", name2, arg[1])
}
else {
new player = cmd_target(id,arg,3)
if (!player) return PLUGIN_HANDLED
set_user_godmode(player,str_to_num(arg2))
new name[32]
get_user_name(player,name,31)
switch(get_cvar_num("amx_show_activity")) {
case 2: client_print(0, print_chat, "%L", LANG_PLAYER, "AINO_GODMODE_PLAYER_CASE2", name2, name)
case 1: client_print(0, print_chat, "%L", LANG_PLAYER, "AINO_GODMODE_PLAYER_CASE1", name)
}
console_print(id, "%L", LANG_PLAYER, "AINO_GODMODE_PLAYER_SUCCESS", name)
log_amx("%L", LANG_SERVER, "AINO_LOG_GODMODE_PLAYER", name2, name)
}
return PLUGIN_HANDLED
}
What do I have to change if I wanna set flag z for this cvar (amx_godmode)?
If i replace 'ADMIN_LEVEL_A' with 'ADMIN_USER', I still can't access the command (with flag z enabled). Even if I set it to 'ADMIN_ALL' I don't get access, shouldn't it be accessible for everyone then?
|