Raised This Month: $12 Target: $400
 3% 

[REQ] HP Bonus after kill + Effects


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 08-07-2014 , 08:49   [REQ] HP Bonus after kill + Effects
Reply With Quote #1

Hi everyone ! Can someone write me this plugin :

Hp Bonus after(cvar for hp bonus) :
  • kill
  • headshot kill
  • knife kill
  • he grenade kill

Also cvar for these :
  • fade screen for killer(RGB)
  • fade screen for victim(RGB)
  • and cvar for random fade screen
  • fade screen time
  • cvar for how slow to appear the fade screen
  • cvar for how slowly disappearing the fade screen
  • and cvar for maximun HP

Thanks in advance.
Lolz0r is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 08-07-2014 , 20:46   Re: [REQ] HP Bonus after kill + Effects
Reply With Quote #2

There is no need (for me) for all these cvars for something so simple. I've commented the thing you can change, it's not a big deal. See the consts in the beginning, also you can see the RGB system of screenfade messages.
For now the message for the killer is green, and for the victim is red.
Those:
Code:
	write_short(4096)
	write_short(4096)
The first is duration, the second is holdtime.
Here:
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fun>

#define PLUGIN "Kill Bonuses"
#define VERSION "1.0"
#define AUTHOR "Flicker"

#define FFADE_IN 0x0000

const MAX_HP 150     //Max health
const BONUS_HEAD 8     //Headshot kil
const BONUS_GREN 10    //Grenade kill
const BONUS_KNIFE 15     //Knife kill
const BONUS_NORMAL 5     //Normal kill

new g_msgScreenFade

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("DeathMsg""onDeathMsgEvent""a")
    
    
g_msgScreenFade get_user_msgid("ScreenFade")
}

public 
onDeathMsgEvent()
{
    new 
killer read_data(1)
    new 
victim read_data(2)
    
    new 
szWeapon[32]
    
read_data(4szWeaponcharsmax(szWeapon))
    
    if(
victim == killer || !is_user_alive(killer))
        return 
PLUGIN_HANDLED
    
    
new bonus
    
    
if(equali(szWeapon"knife"))
        
bonus BONUS_KNIFE
    
else if(equali(szWeapon"grenade"))
        
bonus BONUS_GREN
    
else if(read_data(3))
        
bonus BONUS_HEAD
    
else
        
bonus =BONUS_NORMAL
    
    set_bonus_hp
(killerbonus)
    
    
    
    
message_begin(MSG_ONE_UNRELIABLEg_msgScreenFade,_killer)
    
write_short(4096)
    
write_short(4096)
    
write_short(FFADE_IN)
    
write_byte (0)         //Red
    
write_byte (255)    //Green
    
write_byte (0)         //Blue
    
write_byte (255)
    
message_end()
    
    
message_begin(MSG_ONE_UNRELIABLEg_msgScreenFade,_victim)
    
write_short(4096)
    
write_short(4096)
    
write_short(FFADE_IN)
    
write_byte (255)    //Red
    
write_byte (0)        //Green
    
write_byte (0)        //Blue
    
write_byte (255)
    
message_end()
    
    
    return 
PLUGIN_CONTINUE
}

stock set_bonus_hp(const id, const hp)
    
set_user_health(idclamp(get_user_health(id) + hp0MAX_HP)) 
__________________

Last edited by Flick3rR; 08-08-2014 at 09:47.
Flick3rR is offline
Send a message via Skype™ to Flick3rR
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 08-08-2014 , 09:23   Re: [REQ] HP Bonus after kill + Effects
Reply With Quote #3

I test the plugin with PODBOT and fade don't work.
Lolz0r is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 08-08-2014 , 09:47   Re: [REQ] HP Bonus after kill + Effects
Reply With Quote #4

Try now. I haven't tested exactly that one, but I often use that type of screenfade and it's working properly.
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 08-08-2014 , 10:08   Re: [REQ] HP Bonus after kill + Effects
Reply With Quote #5

Good job, thanks!
Lolz0r is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode