Raised This Month: $535 Target: $400
 133% 

[REQ] help me a little bit.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bojka
Junior Member
Join Date: Dec 2015
Old 06-27-2016 , 11:24   [REQ] help me a little bit.
Reply With Quote #1

Hi , can anyone help me adding cvar to this code i want to turn it on off sometimes this is powered by : Bugsy



PHP Code:
#include <amxmodx>
#include <hamsandwich>

#define MAX_PLAYERS 32
#define DMG_GRENADE (1<<24)
#define IsPlayer(%1) (1<=%1<=MAX_PLAYERS)

public plugin_init() 
{
    
RegisterHamHam_TakeDamage "player" "TakeDamage" );
}

public 
TakeDamageVictim Inflictor Attacker Float:fDamage DmgBits )
{
    return ( 
IsPlayerAttacker ) && !( DmgBits DMG_GRENADE ) && ( get_user_weaponAttacker ) == CSW_KNIFE ) ) ? HAM_SUPERCEDE HAM_IGNORED;


Last edited by bojka; 06-27-2016 at 11:40.
bojka is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 06-27-2016 , 11:39   Re: [REQ] help me a little bit.
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <hamsandwich>

#define MAX_PLAYERS 32
#define DMG_GRENADE (1<<24)
#define IsPlayer(%1) (1<=%1<=MAX_PLAYERS)

new pEnabled

public plugin_init()
{
    
RegisterHamHam_TakeDamage "player" "TakeDamage" );
    
    
pEnabled register_cvar("dmg_enabled""1")
}

public 
TakeDamageVictim Inflictor Attacker Float:fDamage DmgBits )
{
    if(
get_pcvar_num(pEnabled)) {
        return ( 
IsPlayerAttacker ) && !( DmgBits DMG_GRENADE ) && ( get_user_weaponAttacker ) == CSW_KNIFE ) ) ? HAM_SUPERCEDE HAM_IGNORED;
    }
    return 
HAM_SUPERCEDE;

__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
bojka
Junior Member
Join Date: Dec 2015
Old 06-27-2016 , 11:42   Re: [REQ] help me a little bit.
Reply With Quote #3

Thanks man I appreciate it.
bojka 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 23:49.


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