View Single Post
nonName
Junior Member
Join Date: Feb 2021
Old 02-17-2021 , 01:51   Re: Weapon damage control for Steam ID
Reply With Quote #9

Quote:
Originally Posted by fysiks View Post
All things are relative and subjective. What you asked for was unethical. What you actually wanted may not have been unethical. This is why you should always explain what you actually want instead of some random request, it's less confusing and much quicker, generally.
Yeah it's my bad
I should've explained it more.


Quote:
Originally Posted by Bugsy View Post
You're right I guess, it's simple enough to code or obtain something that abuses admin powers so it's not like I am giving you some breakthrough technology, and it's your servers reputation you'd be hurting. If you want to know how to print chat or HUD messages when someone is inflicting more damage than normal, just ask .

1. Make sure to populate the aaAdmins array exactly as I have it with respect to steam-id's (must be in caps), weapons, and the damage factor.
2. You can define the same player/steam-id more than once to allow different weapons to have different damage factors. If weapon(s) share the same factor, define them in a single array entry like the first example with the AK47, M4A1, etc. For other weapons that have a unique damage factor, define them like the deagle, hegrenade, and knife.

PHP Code:

#include <amxmodx>
#include <hamsandwich>

new const Version[] = "0.1";

enum AdminAbuse
{
    
AuthID35 ],
    
WeaponBits,
    
Float:DamageFactor
}

new const 
g_aaAdmins[][ AdminAbuse ] = 
{
    { 
"STEAM_0:0:12345" , ( << CSW_AK47 ) | ( << CSW_M4A1 ) | ( << CSW_TMP ) , 1.5 } ,
    { 
"STEAM_0:0:12345" , ( << CSW_DEAGLE ) , 2.0 } ,
    { 
"STEAM_0:0:12345" , ( << CSW_HEGRENADE ) , 3.0 } , 
    { 
"STEAM_0:0:12345" , ( << CSW_KNIFE ) , 6.0 }
};

const 
DMG_BULLET = ( << );
const 
DMG_GRENADE = ( << 24 );

new 
Float:g_fWeaponDamageFactorMAX_PLAYERS ][ CSW_P90 ];
new 
g_Bots;

public 
plugin_init() 
{
    
register_plugin"Damage Factor by Steam ID" Version "bugsy" );
    
    
RegisterHamHam_TakeDamage "player" "HamTakeDamage" );
}

public 
client_authorizedid )
{
    if ( 
is_user_botid ) )
    {
        
g_Bots |= ( << ( id 31 ) );
    }
    else
    {
        
g_Bots &= ~( << ( id 31 ) );
        
LoadDamageFactorsid );
    }
}

public 
HamTakeDamagevictim inflictor attacker Float:fDamage damageBits)
{
    if ( !( 
g_Bots & ( << ( attacker 31 ) ) ) && ( ( damageBits DMG_GRENADE ) || ( ( damageBits DMG_BULLET ) && is_user_aliveattacker ) ) ) )
    {
        
SetHamParamFloatfDamage g_fWeaponDamageFactorattacker ][ ( damageBits DMG_GRENADE ) ? CSW_HEGRENADE get_user_weaponattacker ) ] );
        return 
HAM_HANDLED;
    }
    
    return 
HAM_IGNORED;
}

LoadDamageFactorsid )
{
    new 
szAuthID35 ];
    
    
arraysetg_fWeaponDamageFactorid ] , 1.0 sizeofg_fWeaponDamageFactor[] ) ); 
    
get_user_authidid szAuthID charsmaxszAuthID ) );
    
    for ( new 
iAdmin iAdmin sizeofg_aaAdmins ) ; iAdmin++ )
    {
        if ( 
equalszAuthID g_aaAdminsiAdmin ][ AuthID ] ) )
        {
            for ( new 
iWeapon CSW_P228 iWeapon <= CSW_P90 iWeapon++ )
            {
                if ( ( 
<< iWeapon ) & g_aaAdminsiAdmin ][ WeaponBits ] )
                {
                    
g_fWeaponDamageFactorid ][ iWeapon ] = g_aaAdminsiAdmin ][ DamageFactor ];
                }
            }
        }
    }

Thank you bugsy! I will try it. And sorry for not explaining what i wanted. Can i know how to change the damage factor and what are the default damage factors? When you say weapons having the same damage factor according to the defaults or according to me making them the same damage factors so i put them in 1 array?

Also is there a plugin in which you can craft any weapon you want over another weapon? I couldn't find such plugin. Because in entity resource replacement all it does it changing the skin to the player STEAM ID while all the rest of players when they pick it up themselves can't see it, it looks normal to them.

The closest thing i can think of is the Golden AK plugin. The one where you can get the golden ak when doing the command. https://forums.alliedmods.net/showthread.php?p=827532

Except why not make a general one in which u can put models, sounds, sprites and ofc damage to make a new weapon instead of my method. The weapon i replaced on my server for myself was a neat AK skin. I could use the Golden AK plugin and changed it's models but it lacked sounds, sprites, W_model and no admin commands.

That could be lit. Instead of using skin replacements.
And custom weapons are annoying because they are all for ZP... There are barely anything for normal modes.

Last edited by nonName; 02-17-2021 at 02:18.
nonName is offline