搜索
查看: 6537|回复: 20

[AMXX 带源码] 应该会员“火飞寒”要求写的!

[复制链接]
发表于 2009-7-25 15:15:45 | 显示全部楼层 |阅读模式 来自 中国–广东–东莞
  1. #include <amxmodx>
  2. #include <cstrike>

  3. #define PLUGIN_NAME        "award_System"
  4. #define PLUGIN_VERSION        "1.0"
  5. #define PLUGIN_AUTHOR        "K.K.Lv"

  6. #define NAME_LENTH 32
  7. #define MSG_LENTH 128

  8. new award[6] = {5000,6000,7000, 8000, 9000, 10000}
  9. new g_firstblood
  10. new gmsg_sync

  11. public plugin_init()
  12. {
  13.         register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
  14.        
  15.         register_event("DeathMsg", "event_death", "a")
  16.         register_logevent("event_newround", 2, "0=World triggered", "1=Round_Start")
  17.         gmsg_sync = CreateHudSyncObj()
  18. }

  19. public client_print_color(playerid, colorid, message[])
  20. {
  21.         message_begin(playerid?MSG_ONE:MSG_ALL, get_user_msgid("SayText"), {0, 0, 0}, playerid)
  22.         write_byte(colorid)
  23.         write_string(message)
  24.         message_end()
  25. }

  26. public event_newround()
  27. {
  28.         g_firstblood = 1
  29. }

  30. public event_death()
  31. {
  32.         new killer = read_data(1)
  33.         new victim = read_data(2)
  34.         new killer_name[NAME_LENTH]
  35.         new victim_name[NAME_LENTH]
  36.         get_user_name(killer, killer_name, charsmax(killer_name))
  37.         get_user_name(victim, victim_name, charsmax(victim_name))
  38.         new money = cs_get_user_money(killer)
  39.         new headshot = read_data(3)
  40.         new weapon [24]
  41.         read_data(4, weapon, 23)
  42.         if (get_user_team(killer) != get_user_team(victim))
  43.         {
  44.                 if (g_firstblood == 1)
  45.                 {
  46.                         g_firstblood = 2
  47.                         new awardmoney = award[random(6)]
  48.                         new msg[MSG_LENTH], hud_msg[MSG_LENTH]
  49.                         format(hud_msg, charsmax(msg), "%s 一马当先^n英勇杀敌^n奖励 %d 金钱", killer_name, awardmoney)
  50.                         format(msg, charsmax(msg), "^x03%s ^x04一马当先,英勇杀敌,奖励 ^x03%d ^x04金钱", killer_name, awardmoney)
  51.                         set_hudmessage(100, 100, 255, 0.75, 0.29, 1, 6.0, 1.5, 0.5, 0.15, 1)
  52.                         client_print_color(0, killer, msg)
  53.                         ShowSyncHudMsg(0, gmsg_sync, hud_msg)
  54.                         cs_set_user_money(killer, money + awardmoney)
  55.                 }
  56.                 else if (g_firstblood == 2)
  57.                 {
  58.                         g_firstblood = 3
  59.                         new awardmoney = 2500
  60.                         new hud_msg[MSG_LENTH]
  61.                         format(hud_msg, charsmax(hud_msg), "%s 第二人杀敌^n奖励 %d 金钱", killer_name, awardmoney)
  62.                         set_hudmessage(100, 100, 255, 0.75, 0.29, 1, 6.0, 1.5, 0.5, 0.15, 1)
  63.                         ShowSyncHudMsg(0, gmsg_sync, hud_msg)
  64.                         cs_set_user_money(killer, money + awardmoney)
  65.                 }
  66.                 else if (g_firstblood == 3)
  67.                 {
  68.                         g_firstblood = 4
  69.                         new awardmoney = 1500
  70.                         new hud_msg[MSG_LENTH]
  71.                         format(hud_msg, charsmax(hud_msg), "%s 第三个杀敌^n奖励 %d 金钱", killer_name, awardmoney)
  72.                         set_hudmessage(100, 100, 255, 0.75, 0.29, 1, 6.0, 1.5, 0.5, 0.15, 1)
  73.                         ShowSyncHudMsg(0, gmsg_sync, hud_msg)
  74.                         cs_set_user_money(killer, money + awardmoney)
  75.                 }
  76.                 if (headshot)
  77.                 {
  78.                         new awardmoney = 1500
  79.                         new msg[MSG_LENTH], hud_msg[MSG_LENTH]
  80.                         format(hud_msg, charsmax(msg), "%s 一枪打爆 %s 的头^n奖励 %d 金钱", killer_name, victim_name, awardmoney)
  81.                         format(msg, charsmax(msg), "^x03%s ^x04爆头奖励 ^x03%d ^x04金钱", killer_name, awardmoney)
  82.                         set_hudmessage(255, 100, 100, -1.0, 0.25, 1, 6.0, 6.0, 0.5, 0.15, 1)
  83.                         client_print_color(0, killer, msg)
  84.                         ShowSyncHudMsg(0, gmsg_sync, hud_msg)
  85.                         cs_set_user_money(killer, money + awardmoney)
  86.                 }
  87.                 if (weapon[0] == 'k' && !headshot)
  88.                 {
  89.                         new msg[MSG_LENTH], hud_msg[MSG_LENTH]
  90.                         format(msg, charsmax(msg), "^x03%s ^x04使用匕首杀敌,奖励^x03 10000 ^x04金钱", killer_name)
  91.                         format(hud_msg, charsmax(hud_msg), "%s 用刀戳死了 %s", killer_name, victim_name)
  92.                         set_hudmessage(255, 100, 100, -1.0, 0.25, 1, 6.0, 6.0, 0.5, 0.15, 1)
  93.                         ShowSyncHudMsg(0, gmsg_sync, hud_msg)
  94.                         client_print_color(0, killer, msg)
  95.                         cs_set_user_money(killer, money + 10000)
  96.                 }
  97.                 if(weapon[1] == 'r' && !read_data(3))
  98.                 {
  99.                         new msg[MSG_LENTH], hud_msg[MSG_LENTH]
  100.                         format(msg, charsmax(msg), "^x03%s ^x04使用高爆手雷弹杀敌,奖励^x03 3000 ^x04金钱", killer_name)
  101.                         format(hud_msg, charsmax(hud_msg), "%s 使用高爆手雷弹把 %s 炸得粉身碎骨", killer_name, victim_name)
  102.                         set_hudmessage(255, 100, 100, -1.0, 0.25, 1, 6.0, 6.0, 0.5, 0.15, 1)
  103.                         ShowSyncHudMsg(0, gmsg_sync, hud_msg)
  104.                         client_print_color(0, killer, msg)
  105.                         cs_set_user_money(killer, money + 3000)
  106.                 }
  107.         }
  108. }
复制代码
发表于 2009-7-25 16:55:09 | 显示全部楼层 来自 中国–广东–广州
不错,支持共享精神
回复

使用道具 举报

发表于 2009-7-25 17:30:34 | 显示全部楼层 来自 中国–吉林–长春
太熟练了 佩服
回复

使用道具 举报

发表于 2009-7-28 06:13:52 | 显示全部楼层 来自 中国–浙江–杭州
大力支持楼主的共享精神
回复

使用道具 举报

发表于 2009-7-28 12:38:55 | 显示全部楼层 来自 中国–台湾
{:3_56:}
你寫的?!
回复

使用道具 举报

 楼主| 发表于 2009-7-28 13:09:31 | 显示全部楼层 来自 中国–广东–东莞
6# jasonchu9


有问题吗!
回复

使用道具 举报

发表于 2009-7-28 17:05:16 | 显示全部楼层 来自 中国–河南–南阳
我求插件求了半天都没人帮下。。这都有```
回复

使用道具 举报

发表于 2009-7-29 00:31:33 | 显示全部楼层 来自 中国–广东–珠海
请问楼主会写插件吗,我想搞个混F,带军衔,注册ID,经验和加血的,会的朋友请加我QQ:52951135
回复

使用道具 举报

发表于 2009-7-29 10:13:19 | 显示全部楼层 来自 中国–上海–上海–徐汇区
是楼猪自己的原创么,还是整合其它插件,千万不要轻易谋杀他人的劳动成果。
回复

使用道具 举报

 楼主| 发表于 2009-7-29 11:37:46 | 显示全部楼层 来自 中国–广东–东莞
10# topstar


是不是你自己看了!其实这种插件都差不多了!
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表