View Single Post
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 03-28-2020 , 10:43   Re: VIP Menu Plugin problems with compiling
Reply With Quote #2

Made an example for you

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>

#define PLUGIN "Bonus HP Example"
#define VERSION "1.0"
#define AUTHOR "NapoleoN#"

new pHeadShot;
new 
pKill;
new 
pMaxHp;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_event("DeathMsg""eDeath""a"); // Register DeathMsg Event.
    
    
pHeadShot register_cvar("amx_headshot""30");
    
pKill register_cvar("amx_kill""15");
    
pMaxHp register_cvar("amx_maxhp""100");
}

public 
eDeath()
{
    
// Save our info.
    
new iAttacker read_data(1);
    new 
iVictim read_data(2);
    
    if(
is_user_alive(iAttacker) && iAttacker != iVictim && iAttacker != && get_user_team(iAttacker) != get_user_team(iVictim))
    {
        new 
iMaxHp get_pcvar_num(pMaxHp);
        new 
iHeadShot read_data(3);
        
        if(
iHeadShot)
        {
            
set_user_health(iAttackerclamp(get_user_health(iAttacker) + get_pcvar_num(pHeadShot), 0iMaxHp));
        }
        
        else
        {
            
set_user_health(iAttackerclamp(get_user_health(iAttacker) + get_pcvar_num(pKill), 0iMaxHp));
        }
    }

__________________

Last edited by Napoleon_be; 03-28-2020 at 10:44.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be