Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <fakemeta>
- new g_MsgScreenFade
- public plugin_init() {
- register_plugin("blablabla","isto to","i ovde")
- register_event( "Damage", "event_damage", "b", "2!0", "3=0", "4!0");
- g_MsgScreenFade = get_user_msgid("ScreenFade")
- // Add your code here...
- }
- public event_damage(id)
- {
- new attacker = get_user_attacker(id)
- new health = get_user_health(id)
- if(!Is_Valid_User( attacker ) )
- return PLUGIN_HANDLED
- if(health < 45)
- {
- fw_Heal( id )
- }
- return PLUGIN_CONTINUE
- }
- public fw_Heal( index )
- {
- if(!is_user_alive(index))
- return PLUGIN_HANDLED
- new health = get_user_health(index)
- if(health < 100)
- {
- set_pev(index, pev_health, pev(index, pev_health) + 5.0)//setuje HP
- emit_sound(index, CHAN_ITEM, "cod_bo/heal.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);//Sound
- message_begin(MSG_ONE, g_MsgScreenFade, {0,0,0}, index);
- write_short(5<<10); //Oko trajanja nesto
- write_short(3<<5); //Fade
- write_short(1<<1); // Tip fade-a (in / out, 1 - 0 )
- write_byte(200); // crvena
- write_byte(0); // zelena
- write_byte(0); // plava
- write_byte(90); // Alpha....
- message_end();
- if(health < 100)
- {
- set_task(1.0, "fw_Heal", index)
- }
- }
- else if(health > 100)
- set_pev(index,pev_health, 100)
- return PLUGIN_CONTINUE
- }
- public Is_Valid_User( id )
- {
- if( is_user_connected( id ) && ( pev( id, pev_flags ) & FL_CLIENT ) )
- return true;
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment