|
楼主 |
发表于 2009-2-8 21:02:11
|
显示全部楼层
来自 中国–上海–上海–松江区
如下为插件源码,需要的就复制粘贴自行编译,需要RULZY斑斑发布的unlimited_money.inc文件。
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <csx>
#include <engine>
#include <unlimited_money>
#define PLUGIN "SniperMoney" //原名为:GoodSniper
#define VERSION "1.0"
#define AUTHOR "Enigmaya" //原创Enigmaya为盲狙报告,landyhsu修改为盲狙奖励
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("amx_sniper_money","2000")
}
//以下为landyhsu加入
public client_color(id,msg[]){
new playerslist[32],playerscount//,i
get_players(playerslist,playerscount,"c")
while(replace(msg,127,"0x01","^x01")){}
while(replace(msg,127,"0x02","^x02")){}
while(replace(msg,127,"0x03","^x03")){}
while(replace(msg,127,"0x04","^x04")){}
if(id==0){
message_begin(MSG_ALL, get_user_msgid("SayText"), {0,0,0},1)
write_byte(1)
write_string(msg)
message_end()
}
else{
message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id)
write_byte(id)
write_string(msg)
message_end()
}
}
//以上为加入
public client_death(killer,victim,wpnindex,hitplace,TK)
{
if( wpnindex!=18 || TK==1 )
return PLUGIN_CONTINUE
if( get_user_button(killer)==2049 ){
new msg[128]
new SniperMoney = get_cvar_num("amx_sniper_money")
new pname[32],name[32]
get_user_name(killer,pname,31)
get_user_name(victim,name,31)
cs_set_user_money2(killer, cs_get_user_money2(killer) + SniperMoney)
format(msg,127,"0x01玩家:0x04%s 0x01用盲狙杀死 0x04%s,0x01奖励:0x03$%d元", pname,name,SniperMoney)
client_color(0,msg)
}
return PLUGIN_CONTINUE
} |
|