public clcmd_say(id)
{
read_args (message, 127)
remove_quotes (message)
new name[128]
get_user_name (id, name, 127)
static szArg1[128], szArg2[128], szArg3[128];
copy(szArg1, charsmax(szArg1), "")
copy(szArg2, charsmax(szArg2), "")
copy(szArg3, charsmax(szArg3), "")
parse(message, szArg1, charsmax(szArg1), szArg2, charsmax(szArg2), szArg3, charsmax(szArg3))
if (message[0] == '@' || message[0] == '%' || equal (message, ""))
return PLUGIN_CONTINUE
if(register[id])
{
new alive[128]
if (is_user_alive (id))
alive = ""
else
alive = "\y*死亡*"
if(login[id])
{
if (message[0] == '@' || message[0] == '/' || message[0] == '%' || message[0] == '#' || equal (message, ""))
return PLUGIN_CONTINUE
client_printc(0, "%s%s:%s",alive, name, message)
}
else
{
if(equali( szArg1, "/log") && !(equali( szArg2, "")))
{
new text[128], len, line = 0
while(read_file( g_motdFile, line++, text, 127, len))
{
if(如果szArg2 = 密码)
login[id] = true
else
client_printc(id, "\g[密码の讯息: 密码错误,请重新输入]")
}
}
else
{
client_printc(id, "\g[密码の讯息: 请输入/log <密码> 登入游戏]")
return PLUGIN_CONTINUE
}
}
}
else
{
if(equali( szArg1, "/reg") && !(equali( szArg2, "")))
{
if(file_exists(g_motdFile))
{
new text[128], len, line = 0
while(read_file( g_motdFile, line++, text, 127, len))
{
if( containi( szArg2, text) != -1 )
{
client_printc(id, "\g[密码の讯息: 请勿使用此密码]")
return PLUGIN_CONTINUE
}
}
}
if(1 > strlen(szArg2))
{
client_printc(id, "\g[密码の讯息: 请输入密码]")
return PLUGIN_CONTINUE
}
if(equali(g_c[id], ""))
{
new Buffer[128]
format(Buffer, sizeof Buffer - 1, "^"%s^" ^"%s^"^n", name, szArg2)
copy(g_c[id], sizeof g_c - 1, szArg2)
new file = fopen(users_db_file, "at+")
fprintf(file, Buffer)
fclose(file)
}
else
{
new Buffer[128], counter
new file = fopen(users_db_file, "rt")
if(file)
{
while(!feof(file))
{
fgets(file, Buffer, 127)
parse(Buffer, Buffer, sizeof Buffer -1)
if(equal(Buffer, name))
{
format(Buffer, sizeof Buffer - 1, "^"%s^" ^"%s^"", name, szArg2)
copy(g_c[id], sizeof g_c - 1, szArg2)
write_file(users_db_file, Buffer, counter)
}
counter++
}
fclose(file)
}
}
client_printc(id, "\g[密码の讯息: 密码以设定为为:%s]", szArg2)
register[id] = 1
}
else
{
client_printc(id, "\g[密码の讯息: 请输入/reg <密码> 注册密码]")
return PLUGIN_CONTINUE
}
}
return PLUGIN_CONTINUE
}
我搞到快疯了..
会的话教下我吧..