I run this plugin on server & i wanted to add some extra code to it besides removing admins - also adding, i know there is amx_addadmin already but i wanted something different for ex amx_setadmin "name/steamid" -- when it's exectued i want it to add only one flag to the player "ADMIN_LEVEL_H", t flag and also to save on user2.ini.... CODE BELOW
Spoiler
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Remove admins"
#define VERSION "0.2"
#define AUTHOR "SweatyBanana"
enum{TYPE_STEAM,TYPE_NAME}
public plugin_init()
{
register_plugin(PLUGIN,VERSION,AUTHOR);
register_cvar("ar_version",VERSION,FCVAR_SERVER);
register_clcmd("amx_removeadmin","remove_cmd",ADMIN_RCON,"amx_removeadmin <steamid or nick>");
}
public remove_cmd(id,level,cid)
{
if(!(get_user_flags(id) & ADMIN_RCON))
return PLUGIN_HANDLED;
new players[32], inum, i, player;
new TARGET[32], playerinfo[32];
new command_type;
new bool:is_found = false;
console_print(id,"********************ADMIN ID REMOVAL TOOL**************");
console_print(id,"");
console_print(id," The target, %s, was removed from users.ini ",TARGET);
console_print(id,"");
console_print(id,"********************ADMIN ID REMOVAL TOOL**************");
server_cmd("amx_reloadadmins")
break;
}
}
if(!is_found)
{
console_print(id,"********************ADMIN ID REMOVAL TOOL**************");
console_print(id," The entry, %s, was not found in users.ini ",TARGET);
console_print(id,"********************ADMIN ID REMOVAL TOOL**************");
}