|
本帖最后由 cityhonghu 于 2009-9-20 22:38 编辑
参考了,ruzly斑主的client_coler已经解决
以下为各种杀人奖励代码,插件本身运行没有问题。
只是奖励时显示的玩家名字一律为红色,请帮忙修改为名字按照队伍颜色显示。
谢谢- #include <amxmodx>
- #include <cstrike>
- new p_lastk=0,p_lastk_count=0
- public plugin_init() {
-
- register_plugin("MultiKill", "1.0", "Marshall")
- register_event("DeathMsg", "hook_death", "a")
- register_logevent("hook_roundstart",2,"0=World triggered","1=Round_Start")
- }
- public hook_death(){
-
- new p_message[128]
- new Killer = read_data(1)
- new headshot = read_data(3)
- new p_weapon[16]
- read_data(4,p_weapon,15)
-
- //爆头奖励
- if(headshot){
- new p_name[16]
- get_user_name(Killer,p_name,15)
- format(p_message,127,"^x04爆头奖励:^x03%s^x01 获得$1000!",p_name)
- color_message(p_message)
- cs_set_user_money(Killer,cs_get_user_money(Killer) + 1000)
- }
- //刀杀奖励
- if(strcmp(p_weapon,"knife")==0){
- new p_name[16]
- get_user_name(Killer,p_name,15)
- format(p_message,127,"^x04刀杀奖励:^x03%s^x01 获得$5000!",p_name)
- color_message(p_message)
- cs_set_user_money(Killer,cs_get_user_money(Killer) + 5000)
- }
-
- //雷杀奖励
- if(strcmp(p_weapon,"grenade")==0){
- new p_name[16]
- get_user_name(Killer,p_name,15)
- format(p_message,127,"^x04雷杀奖励:^x03%s^x01 获得$1500!",p_name)
- color_message(p_message)
- cs_set_user_money(Killer,cs_get_user_money(Killer) + 1500)
- }
-
- //连续杀人奖励
- if(p_lastk != Killer){
- p_lastk = Killer
- p_lastk_count =1
- }
- else
- p_lastk_count++
-
- if(p_lastk_count>=5){
- new p_name[16]
- get_user_name(Killer,p_name,15)
- format(p_message,127,"^x04连续杀人奖励:^x03%s^x01 连续杀人5次,获得$3000!",p_name)
- color_message(p_message)
- cs_set_user_money(Killer,cs_get_user_money(Killer) + 3000)
- }
- }
- public hook_roundstart(){
- p_lastk=0
- p_lastk_count=0
- }
- color_message(p_message[]){
- message_begin(MSG_ALL, get_user_msgid("SayText"))
- write_byte(1)
- write_string(p_message)
- message_end()
- }
- /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
- *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2052\\ f0\\ fs16 \n\\ par }
- */
复制代码 |
|