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

[REQ]100HP plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Sanjay Singh
Veteran Member
Join Date: Sep 2016
Old 11-18-2016 , 04:28   Re: [REQ]100HP plugin
Reply With Quote #11

I said my idea and to make for me thats it
__________________
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 11-19-2016 , 01:05   Re: [REQ]100HP plugin
Reply With Quote #12

Code:
#include <amxmodx>
#include <cstrike>
#include <fun>

#define Tag "[Bonus Health]"

static const PLUGIN_NAME[] 	= "-";
static const PLUGIN_AUTHOR[] 	= "-";
static const PLUGIN_VERSION[]	= "1.0";

new sz_MapName[32];
new cStatus, cMaxHealth;
new cHeadshot, cKnifeHeadshot;

public plugin_init() {
    register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);

    cStatus        = register_cvar("bonus_status", "1");

    cMaxHealth    = register_cvar("bonus_maxhealth", "100");
    cHeadshot    = register_cvar("bonus_headshot", "100");
    cKnifeHeadshot    = register_cvar("bonus_knifeheadshot", "100");
    
    /* Player Killed */
    register_event( "DeathMsg", "EventDeathMsg", "a", "1>0" );
}
/*
Bonus:
- Player Killed
*/
public EventDeathMsg() {
    new killer = read_data(1);
    new victim = read_data(2);
    new headshot = read_data(3);
    new weapon = get_user_weapon(killer);
    new num;
    
    if(killer == victim || !get_pcvar_num(cStatus) || !is_user_connected(victim) || !is_user_alive(killer))
        return PLUGIN_HANDLED;

    get_mapname( sz_MapName, charsmax( sz_MapName ) )
    if( containi( sz_MapName, "ka_" ) == 0 )

    if(headshot && weapon == CSW_KNIFE) {
        num = get_pcvar_num(cKnifeHeadshot)
        GiveHealth(killer, num)
        HudMessage(killer, "Healed +%ihp", num)
    } else if(headshot) {
        num = get_pcvar_num(cHeadshot)
        GiveHealth(killer, num)
        HudMessage(killer, "Healed +%ihp", num)
    }
    return PLUGIN_CONTINUE;
}

GiveHealth(id, count)
    set_user_health(id, min( (get_user_health(id) + count), get_pcvar_num(cMaxHealth) ))
stock HudMessage(const id, const input[], any:...) {
    static msg[191];
    vformat(msg, 190, input, 3);
    
    set_hudmessage(127, 170, 255, 0.27, 0.14, 0, 5.0, 5.0, 0.0, 0.0, -1);
    show_hudmessage(id, "%s^n%s", Tag, msg)
}
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
Reply



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 09:06.


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