|
发表于 2008-2-29 19:19:50
|
显示全部楼层
|阅读模式
来自 中国–内蒙古–锡林郭勒盟
[PHP]
get_user_info(id,"name",username,31)
get_user_info(id,passfield,userpwd,31)
replace_all(username,31,"[","[")
replace_all(username,31,"]","]")
replace_all(username,31,"<","<")
replace_all(username,31,">",">")
new g_sqlpwd[12]
new g_Signature[64]
new g_realname[32]
new g_kills[12]
new g_deaths[12]
new g_score[12]
g_dbc = dbi_connect(g_host,g_user,g_pass,g_dbname,g_error,MAX_NAME_LENGTH)
if (g_dbc == SQL_FAILED)
log_amx("[RegSqlRank] SQL Connection Failed")
else
{
result = dbi_query(g_dbc,"set names utf8;")
result = dbi_query(g_dbc,"select * from `%s` where Username = '%s'", g_sqlstats_table, username)
if (result == RESULT_FAILED)
{
log_amx("[RegSqlRank] Sorry,No DataBase or Table")
}
else if(result == RESULT_NONE)
{
dbi_free_result(result)
dbi_close(g_dbc)
new szMessage[192];
format( szMessage, 191, "^x04【未注册用户】^x03%s^x04【来自】^x03%s-%s",username,szCountry,szArea)
display_chat( szMessage);
format( szMessage, 191, "^x04【个性签名】^x03请到http://klwbcs.vicp.net注册才能显示");
display_chat( szMessage);
}
else
{
dbi_result(result, "Password", g_sqlpwd, 31)
dbi_result(result, "Real_name",g_realname,31)
dbi_result(result, "Signature",g_Signature,63)
dbi_result(result, "kills",g_kills,11)
dbi_result(result, "deaths",g_deaths,11)
dbi_result(result, "score",g_score,11)
dbi_free_result(result)
dbi_close(g_dbc)
g_dbc = dbi_connect(g_host,g_user,g_pass,g_dbname,g_error,MAX_NAME_LENGTH)
result = dbi_query(g_dbc,"select * from `%s` where score >= '%s'", g_sqlstats_table, g_score)
iRankPos = dbi_num_rows(result)
dbi_free_result(result)
dbi_close(g_dbc)
new szMessage[192];
format( szMessage, 191, "^x01* 欢迎【^x04%s^x01】^x03%s^x01 -->>【排名】第^x04%d^x01名【来自】^x04%s^x01 - ^x04%s",iRank(), username, iRankPos, szCountry, szArea);
display_chat( szMessage);
format( szMessage, 191, "^x03【个性签名】^x04%s", g_Signature);
display_chat( szMessage);
}
[/PHP] |
|