Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #include <fun>
- new const HP_ADD[2] = {
- 25,
- 15
- }
- public plugin_init() {
- register_plugin("","","")
- register_event("DeathMsg", "hook_death", "a", "1>0")
- // Add your code here...
- }
- public hook_death()
- {
- new killer = read_data(1)
- new victim = read_data(2)
- if(!is_user_connected(killer))
- return;
- set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
- if ((read_data(3) == 1) && (read_data(5) == 0))
- {
- set_user_health(killer, get_user_health(killer)+HP_ADD[0])
- show_hudmessage(killer, "+%d hp", HP_ADD[0])
- }
- else
- {
- set_user_health(killer, get_user_health(killer)+HP_ADD[1])
- show_hudmessage(killer, "+%d hp", HP_ADD[1])
- }
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), {0,0,0}, killer)
- write_short(1<<10)
- write_short(1<<10)
- write_short(0x0000)
- write_byte(0)
- write_byte(200)
- write_byte(0)
- write_byte(75)
- message_end()
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), {0,0,0}, victim)
- write_short(1<<10)
- write_short(1<<10)
- write_short(0x0000)
- write_byte(200)
- write_byte(0)
- write_byte(0)
- write_byte(75)
- message_end()
- }
Advertisement
Add Comment
Please, Sign In to add comment