Code:
#include <amxmodx>
#include <amxmisc>
new usersfile[40] = ""
public amx_user_add(id,level,cid) {
if (!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED
new arg[32]
new AUTHID
new player
new f_admin[15]
new f_password[15]
new f_access[25]
new f_flags[15]
new line = 1
new RF_line[100]
new found = 0
new user_name[32]
read_argv(1,arg,32)
player = cmd_target(id,arg,0)
if(!player)
return PLUGIN_HANDLED
AUTHID = get_user_authid(player)
get_user_name(player,user_name,32)
while(line != 0) {
line = read_file(usersfile,line,RF_line,100,line)
parse(RF_line,f_admin,15,f_password,15,f_access,25,f_flags,15)
if (str_to_num(f_admin) == AUTHID){
found = 1
break
}
}
if(found) {
console_print(id,"Player: %s, is already in the users.ini!",user_name)
return PLUGIN_HANDLED
}
new WF_name[32]
new WF_line[100]
format(WF_line,100,"^"%d^" ^"*^" ^"bcdefghijkmnopqrstuz^" ^"ce^"",AUTHID)
format(WF_name,32,"^n//%s",user_name)
write_file(usersfile,WF_name,-1)
write_file(usersfile,WF_line,-1)
set_user_flags(AUTHID,read_flags("bcdefghijkmnopqrstuz"))
client_print(id,print_console,"%s(%d) added as an admin!",user_name,AUTHID)
return PLUGIN_HANDLED
}
public amx_user_edit(id,level,cid) {
if (!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED
thats the plugin i got now... im trying to make it so AuthId will work... i tried that way i gto it now... but i get a warning.