|
- #include <amxmodx>
- #include <cstrike>
- #define PLUGIN_NAME "award_System"
- #define PLUGIN_VERSION "1.0"
- #define PLUGIN_AUTHOR "K.K.Lv"
- #define NAME_LENTH 32
- #define MSG_LENTH 128
- new award[6] = {5000,6000,7000, 8000, 9000, 10000}
- new g_firstblood
- new gmsg_sync
- public plugin_init()
- {
- register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
-
- register_event("DeathMsg", "event_death", "a")
- register_logevent("event_newround", 2, "0=World triggered", "1=Round_Start")
- gmsg_sync = CreateHudSyncObj()
- }
- public client_print_color(playerid, colorid, message[])
- {
- message_begin(playerid?MSG_ONE:MSG_ALL, get_user_msgid("SayText"), {0, 0, 0}, playerid)
- write_byte(colorid)
- write_string(message)
- message_end()
- }
- public event_newround()
- {
- g_firstblood = 1
- }
- public event_death()
- {
- new killer = read_data(1)
- new victim = read_data(2)
- new killer_name[NAME_LENTH]
- new victim_name[NAME_LENTH]
- get_user_name(killer, killer_name, charsmax(killer_name))
- get_user_name(victim, victim_name, charsmax(victim_name))
- new money = cs_get_user_money(killer)
- new headshot = read_data(3)
- new weapon [24]
- read_data(4, weapon, 23)
- if (get_user_team(killer) != get_user_team(victim))
- {
- if (g_firstblood == 1)
- {
- g_firstblood = 2
- new awardmoney = award[random(6)]
- new msg[MSG_LENTH], hud_msg[MSG_LENTH]
- format(hud_msg, charsmax(msg), "%s 一马当先^n英勇杀敌^n奖励 %d 金钱", killer_name, awardmoney)
- format(msg, charsmax(msg), "^x03%s ^x04一马当先,英勇杀敌,奖励 ^x03%d ^x04金钱", killer_name, awardmoney)
- set_hudmessage(100, 100, 255, 0.75, 0.29, 1, 6.0, 1.5, 0.5, 0.15, 1)
- client_print_color(0, killer, msg)
- ShowSyncHudMsg(0, gmsg_sync, hud_msg)
- cs_set_user_money(killer, money + awardmoney)
- }
- else if (g_firstblood == 2)
- {
- g_firstblood = 3
- new awardmoney = 2500
- new hud_msg[MSG_LENTH]
- format(hud_msg, charsmax(hud_msg), "%s 第二人杀敌^n奖励 %d 金钱", killer_name, awardmoney)
- set_hudmessage(100, 100, 255, 0.75, 0.29, 1, 6.0, 1.5, 0.5, 0.15, 1)
- ShowSyncHudMsg(0, gmsg_sync, hud_msg)
- cs_set_user_money(killer, money + awardmoney)
- }
- else if (g_firstblood == 3)
- {
- g_firstblood = 4
- new awardmoney = 1500
- new hud_msg[MSG_LENTH]
- format(hud_msg, charsmax(hud_msg), "%s 第三个杀敌^n奖励 %d 金钱", killer_name, awardmoney)
- set_hudmessage(100, 100, 255, 0.75, 0.29, 1, 6.0, 1.5, 0.5, 0.15, 1)
- ShowSyncHudMsg(0, gmsg_sync, hud_msg)
- cs_set_user_money(killer, money + awardmoney)
- }
- if (headshot)
- {
- new awardmoney = 1500
- new msg[MSG_LENTH], hud_msg[MSG_LENTH]
- format(hud_msg, charsmax(msg), "%s 一枪打爆 %s 的头^n奖励 %d 金钱", killer_name, victim_name, awardmoney)
- format(msg, charsmax(msg), "^x03%s ^x04爆头奖励 ^x03%d ^x04金钱", killer_name, awardmoney)
- set_hudmessage(255, 100, 100, -1.0, 0.25, 1, 6.0, 6.0, 0.5, 0.15, 1)
- client_print_color(0, killer, msg)
- ShowSyncHudMsg(0, gmsg_sync, hud_msg)
- cs_set_user_money(killer, money + awardmoney)
- }
- if (weapon[0] == 'k' && !headshot)
- {
- new msg[MSG_LENTH], hud_msg[MSG_LENTH]
- format(msg, charsmax(msg), "^x03%s ^x04使用匕首杀敌,奖励^x03 10000 ^x04金钱", killer_name)
- format(hud_msg, charsmax(hud_msg), "%s 用刀戳死了 %s", killer_name, victim_name)
- set_hudmessage(255, 100, 100, -1.0, 0.25, 1, 6.0, 6.0, 0.5, 0.15, 1)
- ShowSyncHudMsg(0, gmsg_sync, hud_msg)
- client_print_color(0, killer, msg)
- cs_set_user_money(killer, money + 10000)
- }
- if(weapon[1] == 'r' && !read_data(3))
- {
- new msg[MSG_LENTH], hud_msg[MSG_LENTH]
- format(msg, charsmax(msg), "^x03%s ^x04使用高爆手雷弹杀敌,奖励^x03 3000 ^x04金钱", killer_name)
- format(hud_msg, charsmax(hud_msg), "%s 使用高爆手雷弹把 %s 炸得粉身碎骨", killer_name, victim_name)
- set_hudmessage(255, 100, 100, -1.0, 0.25, 1, 6.0, 6.0, 0.5, 0.15, 1)
- ShowSyncHudMsg(0, gmsg_sync, hud_msg)
- client_print_color(0, killer, msg)
- cs_set_user_money(killer, money + 3000)
- }
- }
- }
复制代码 |
|