|
发表于 2006-3-9 05:10:48
|
显示全部楼层
|阅读模式
来自 中国–广东–深圳–南山区
偶amxx菜得实在没话说,麻烦各位了~~~让进入服务器的显示排名和地址改为绿色,在clinet_print中使用颜色larnk的掉钱捡钱插件里已经实现了,偶参考了N久那个插件就是看不懂^x04%s^x01是如何配置颜色的 :brick:
martins发布地址http://forum.dt-club.net/showthread.php?t=27718
Yan发布的地址http://forum.dt-club.net/showthread.php?t=27598
贴上martins的进出服务器的源码:
/*
* Enter and Leave Message
* v 1.0
*
*
* rewrited by martins
*
*
*/
/*
* Cvars:
* amx_enter_message "%name% has joined!\nEnjoy in this game!\n(Rank is %rankpos%,IP:%IP%)"
* amx_leave_message "%name% has left!\nI hope you will come back."
*
* If you are using csstats module then you may use
* %rankpos% expression in amx_enter_message cvar.
*
*/
#include <amxmod>
#include <amxmodx>
#include <csstats>
#include <geoip>
public plugin_init() {
register_plugin("Enter-Leave Message","1.0","martins")
register_cvar("amx_enter_message", "Server join: %name% (Rank: %rankpos%)(total:%rankmax%)")
register_cvar("amx_leave_message", "Server leave: %name%")
return PLUGIN_CONTINUE
}
public client_putinserver(id){
new param[34], len
param[0] = id
len = get_user_name(id,param[1],31)
set_task(2.0, "enter_msg", 0, param,len + 2)
return PLUGIN_CONTINUE
}
public client_disconnect(id){
new param[34], len
param[0] = id
len = get_user_name(id, param[1], 31)
set_task(2.0, "leave_msg", 0, param, len + 2)
return PLUGIN_CONTINUE
}
public enter_msg(param[]) {
new message[192],hostname[64]
get_cvar_string("amx_enter_message", message, 191)
get_cvar_string("hostname", hostname, 63)
replace(message,191, "%hostname%", hostname)
new address[32]
get_user_ip(param[0],address,31,1)
new g_address[64]
geoip_country(address,g_address,64)
replace(message,191, "%IP%", g_address)
if (cvar_exists("csstats_reset")){
new data[8], rankpos[8], rankmax[8] , iRankpos , iRankmax
iRankpos = get_user_stats(param[0],data,data)
iRankmax = get_statsnum()
numtostr(iRankpos,rankpos,7)
numtostr(iRankmax,rankmax,7)
replace(message, 191, "%rankpos%", rankpos)
replace(message, 191, "%rankmax%", rankmax)
}
replace(message, 191, "%name%", param[1])
while(replace(message, 191, "\n", "^n")){}
//set_hudmessage(0, 255, 0, 0.10, 0.55, 0, 6.0, 6.0, 0.5, 0.15, 3)
//show_hudmessage(0, message)
client_print(0,print_chat,"%s",message)
return PLUGIN_CONTINUE
}
public leave_msg(param[]) {
new message[192],hostname[64]
get_cvar_string("amx_leave_message", message, 191)
get_cvar_string("hostname", hostname, 63)
replace(message, 191, "%hostname%", hostname)
replace(message, 191, "%name%", param[1])
while(replace(message, 191, "\n", "^n")){}
//set_hudmessage(255, 0, 255, 0.10, 0.55, 0, 6.0, 6.0, 0.5, 0.15, 3)
//show_hudmessage(0, message)
client_print(0,print_chat,"%s",message)
return PLUGIN_CONTINUE
}
另外想保留nwb13源码里的显示地址信息插件的一条信息。
public setSpecMode(id) {
new arg[12]
read_data( 2 , arg , 11 )
g_specMode[id] = ( arg[10] == '4' ) // 设置为第一人称视角
return PLUGIN_HANDLED
}
public showipinfo(id){
if ( g_specMode[id] && g_sql_statu ){
new a = read_data(2)
if ( is_user_connected(a) ){
new name[32]
get_user_name(a,name,31)
format(g_buffer,511,"%s^n来自^n%s^n%s",name,g_country[a],g_addr[a])
set_hudmessage(255, 255, 42, -1.0, 0.79, 0, 6.0, 12.0) // 显示观察视角坐标 下角中间部位
show_hudmessage(id,g_buffer)
}
}
return PLUGIN_HANDLED
}
想要的效果与图类似,高手一起来顶哈~~~ |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|