myhsj 发表于 2006-12-28 09:45:14

请问谁能帮我把这个修改为彩色信息的?

#include <amxmod>
#include <amxmodx>
#include <csstats>
#include <ipseeker>

public plugin_init() {
register_plugin("Enter-Leave Message","1.0","martins")
register_cvar("amx_enter_message", "%name% has joined!\nEnjoy in this game!\n(Rank is %rankpos%,IP:%IP%)")
register_cvar("amx_leave_message", "Server leave: %name%")
return PLUGIN_CONTINUE
}
public client_putinserver(id){
new param, len
param = id
len = get_user_name(id,param,31)
set_task(2.0, "enter_msg", 0, param,len + 2)
return PLUGIN_CONTINUE
}
public client_disconnect(id){
new param, len
param = id
len = get_user_name(id, param, 31)
set_task(2.0, "leave_msg", 0, param, len + 2)
return PLUGIN_CONTINUE
}
public enter_msg(param[]) {
new message,hostname
get_cvar_string("amx_enter_message", message, 191)
get_cvar_string("hostname", hostname, 63)
replace(message,191, "%hostname%", hostname)
new ip
get_user_ip(param, ip, 31, 1)
new addr
ipseeker(ip, ipseek_all, addr, 128, 1)
replace(message,191, "%IP%", addr)
if (cvar_exists("csstats_reset")){
new data, rankpos, rankmax , iRankpos , iRankmax
iRankpos = get_user_stats(param,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, "^x03%name%", param)
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,hostname
get_cvar_string("amx_leave_message", message, 191)
get_cvar_string("hostname", hostname, 63)
replace(message, 191, "%hostname%", hostname)
replace(message, 191, "%name%", param)
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
}

wtswangba 发表于 2006-12-28 10:15:07

回复: 请问谁能帮我把这个修改为彩色信息的?

好象论坛里有这个彩色信息的插件
页: [1]
查看完整版本: 请问谁能帮我把这个修改为彩色信息的?