Code:
#include <amxmodx>
#include <file>
#include <string>
public plugin_init()
{
register_plugin("EXAMPLE NAME RESERVATION","0.1","EXAMPLE NICK")
}
public client_connect(id)
{
log_info(id)
}
public client_infochanged(id)
{
if (!is_user_connected(id) || !get_cvar_num("amx_mode"))
return PLUGIN_CONTINUE
new newname[32], oldname[32]
get_user_name(id, oldname, 31)
get_user_info(id, "name", newname, 31)
if (!equal(newname, oldname))
log_info(id)
return PLUGIN_CONTINUE
}
public log_info(id)
{
new nick[50],pass[50],tmp[100],tmpNick[50],tmpPass[50],st[100],i,a,len,CurrentTime[25]
nick=""
get_user_info(id, "name", nick, 31)
i=-1
a=0
while(i!=0)
{
tmpNick=""
tmpPass=""
tmp=""
i=read_file("addons/amxmodx/nicks.txt",a,tmp,100,len)
parse(tmp,tmpNick,50,tmpPass,50)
if(equal(tmpNick,nick))
{
get_user_info(id,"ledsplej_password",pass,50)
if(equal(tmpPass,pass))
{
CurrentTime=""
get_time("%Y.%d.%m - %H:%M:%S - ",CurrentTime,25)
st=""
add(st,100,CurrentTime)
add(st,100," - ")
add(st,100,nick)
add(st,100,"::")
add(st,100,"OK")
write_file("addons/amxmodx/nicks.log",st)
} else
{
CurrentTime=""
get_time("%Y.%d.%m - %H:%M:%S - ",CurrentTime,25)
st=""
add(st,100,CurrentTime)
add(st,100," - ")
add(st,100,nick)
add(st,100,"::")
add(st,100,"XX")
write_file("addons/amxmodx/nicks.log",st)
client_cmd(id,"echo ^"EXAMPLE.^";disconnect")
}
}
a++
}
}
i need help with this plugin... i dont know what write to add "user nick" or what write in the other file just dont know what to do next... please help