|
发表于 2008-4-9 17:20:02
|
显示全部楼层
来自 中国–广东–深圳–福田区
回复: 關於Nimo的 csmodip插件
[php]#include <amxmodx>
#include <amxmisc>
#include <csstats>
#include <GetIP>
#define PLUGIN "ShowIP"
#define VERSION "1.0"
#define AUTHOR "Shock.V"
new Show_Player[32][256]
//new SayText
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
//register_event("TextMsg","team_join","a","1=1","2&Game_join_te","2&Game_join_ct")
//SayText=get_user_msgid("SayText")
}
public client_putinserver(id)
{
ShowIP(id)
}
public ShowIP(id)
{
if ( !is_user_connected(id))
return PLUGIN_HANDLED
new playerip[17]
get_user_ip(id, playerip, 16, 1)
csmod_ip(playerip,Show_Player[id],255)
set_task(5.0,"ShowMessage",id)
return PLUGIN_CONTINUE
}
/*public team_join()
{
new UserID[32]
read_data(3,UserID,31)
new id = get_user_index(UserID)
if ( !is_user_connected(id))
return PLUGIN_CONTINUE
set_task(5.0,"ShowMessage",id)
return PLUGIN_CONTINUE
}*/
public ShowMessage(id)
{
if ( !is_user_connected(id))
return PLUGIN_CONTINUE
new name[32]
//,message[256]
new playerip2[32]
new izStats[8], izBody[8]
new iRankPos, iRankMax
iRankPos = get_user_stats( id, izStats, izBody )
iRankMax = get_statsnum()
get_user_name(id, name, 31)
get_user_ip(id, playerip2, 31)
set_hudmessage(255, 0, 0, 0.52, 0.5, 2, 3.0, 5.0, 0.1, 0.2, 0)
show_hudmessage(0, "姓名: %s^n目前所在地: %s^nIP登陸: %s^n排名[ %s / %s ]", name, Show_Player[id], playerip2, iRankPos,iRankMax)
//format(message, 255, "^x01歡迎^x03 %s ^x01來自:^x04 %s^n", name, Show_Player[id])
//message_begin(MSG_ALL,SayText)
//write_byte(id)
//write_string(message)
//message_end()
return PLUGIN_CONTINUE
} [/php]
你这样试下!
还不行就查下后台有没有报错! |
|