Raised This Month: $ Target: $400
 0% 

[Request] Block Usp Damage


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 10-08-2021 , 10:39   Re: [Request] Block Usp Damage
Reply With Quote #2

The raw code is too out control to post. It breaks the game. There needs to be balance. Here is some basic code to make the USP only fire blanks and push magnum elites as a counter-measure. It pauses on Gungame and assassinations maps. Warns if using a scope plugin I made is running that is brings back Scope for Colt and works on USP too. The player name code could be added later for those who use Amxx 1.8.2. If using 182 the names will shows as letter n.
CVARS
mp_leets 0|1 - replace default pistols with the Dual-Elites with armor piercing damage.
mp_usp 0|1 - 0 is off USP is normal. 1 is USP fires blanks.
PHP Code:
#include amxmodx
#include engine
#include engine_stocks
#include hamsandwich
#define MAX_NAME_LENGTH 32
#define charsmin        -1
#define fNULL 0.0
new g_leets,g_usp

public plugin_init()
{
    
RegisterHam(Ham_TakeDamage,"player","Damage"0)
    
register_plugin("Elite:no USP""1.0"".sρiηX҉.Snake");
    
g_usp register_cvar("mp_usp""0")
    new 
mapname[MAX_NAME_LENGTH];get_mapname(mapnamecharsmax(mapname))
    if(
containi(mapname,"as_") != charsmin)
    {
        
log_amx "Assassination map detected"
        
pause "a";
    }

    
/*Conflicts with Gungame*/
    
if(get_cvar_pointer("gg_enabled") || get_cvar_pointer("scope_colt_cost"))
        
set_task(10.0,"@eval_incompat",2448)

}

public 
plugin_precache()
{
    new 
ent;g_leets register_cvar("mp_leets""1")
    if(
get_pcvar_num(g_leets))
    {
        
ent find_ent(charsmin,"game_player_equip") ? find_ent(charsmin,"game_player_equip") : create_entity("game_player_equip")
        !
is_valid_ent(ent) ? log_amx("ERROR! Unable to init player equipment functions.") & set_fail_state("unable to equip player"):
        
DispatchKeyValueent"item_assaultsuit""1"),
        
DispatchKeyValueent"weapon_knife""1"),
        
DispatchKeyValueent"weapon_elite""1" ),
        
DispatchKeyValueent"ammo_9mm""4"),
        
DispatchSpawn(ent);
    }


}

@
eval_incompat()
{
    
server_print "Checking if we should control USP damage"

    
if(get_cvar_num("gg_enabled") == 1)
    {
        
log_amx "Gungame is on"
        
pause "a";
    }
    else if(
get_cvar_pointer("scope_colt_cost"))
    
client_print 0print_chat"Scoped colt USP is firing blanks because of .Snake!"
    
server_print "No plugin conflicts found."
}

public 
Damage VictimInflictorAttackerFloat:fDamage )
{
    if(
get_pcvar_num(g_usp) || get_pcvar_num(g_leets))
    {

        if(
is_user_alive(Attacker))
        {
            new 
damwpnname[MAX_NAME_LENGTH]
            new 
weapon get_user_weapon(Attacker)
            
get_weaponname(weapon,damwpnname,charsmax(damwpnname))

            if(
get_pcvar_num(g_usp) && containi(damwpnname,"usp") != charsmin)
            {
                
SetHamParamFloat(4,fNULL)
                
server_print "%n is shooting USP blanks at %n"Attacker,Victim
                client_print 0
print_chat"%n is shooting USP blanks at %n"Attacker,Victim
                client_cmd Attacker
,"spk idiot"
                
return HAM_SUPERCEDE
            
}
            else if(
get_pcvar_num(g_leets) && containi(damwpnname,"elite") != charsmin)
            {

                
SetHamParamFloat(4,fDamage*3.5)
                
client_print 0print_chat"%n is shooting Armor piercers at %n"Attacker,Victim

            
}
            else  return 
HAM_IGNORED




        
}


    }
    return 
HAM_HANDLED

__________________

Last edited by DJEarthQuake; 10-09-2021 at 18:31. Reason: updating
DJEarthQuake is offline
 



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:57.


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