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
}
我搞到快瘋了..
會的話教下我吧..