AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [B]Increases the damage the player[/B] (https://forums.alliedmods.net/showthread.php?t=163466)

K o T 07-30-2011 17:29

[B]Increases the damage the player[/B]
 
Code:
    #include <amxmodx>     #include <amxmisc>     #include <hamsandwich>     #include <fun>     #define PLUGIN "New Plug-In"     #define VERSION "1.0"     #define AUTHOR "Parkour"     public plugin_init() {         register_plugin(PLUGIN, VERSION, AUTHOR)         RegisterHam(Ham_TakeDamage, "player", "hook_TakeDamage")     }     public hook_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)     {         if(is_user_admin(attacker))         {             new Gun = get_user_weapon(attacker)             if(Gun == CSW_KNIFE)             {                 SetHamParamFloat(4, damage*4)             }         }         return HAM_IGNORED     }



how to make weapons of any great damage was not only a knife and only for admins ADMIN_IMMUNITY if(Gun == CSW_ALL)

Exolent[jNr] 07-30-2011 18:50

Re: [B]Increases the damage the player[/B]
 
Code:
    #include <amxmodx>     #include <amxmisc>     #include <hamsandwich>     #define PLUGIN "New Plug-In"     #define VERSION "1.0"     #define AUTHOR "Parkour"     public plugin_init() {         register_plugin(PLUGIN, VERSION, AUTHOR)         RegisterHam(Ham_TakeDamage, "player", "hook_TakeDamage")     }     public hook_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)     {         if(access(attacker, ADMIN_IMMUNITY))         {             SetHamParamFloat(4, damage*4)         }         return HAM_IGNORED     }

Change to check specific flag and remove the weapon check.

K o T 07-30-2011 19:01

Re: [B]Increases the damage the player[/B]
 
Exolent[jNr]
thank you

K o T 08-20-2011 18:25

Re: [B]Increases the damage the player[/B]
 
L 08/21/2011 - 01:24:56: Invalid player id 280
L 08/21/2011 - 01:24:56: [AMXX] Displaying debug trace (plugin "Damage_to_double_all_the_weapons.amxx")
L 08/21/2011 - 01:24:56: [AMXX] Run time error 10: native error (native "get_user_flags")
L 08/21/2011 - 01:24:56: [AMXX] [0] amxmisc.inc::access (line 97)
L 08/21/2011 - 01:24:56: [AMXX] [1] Damage_to_double_all_the_weapons.sma::hook_Ta keDamage (line 16)

Displays errors, the fall of the Player

drekes 08-20-2011 18:54

Re: [B]Increases the damage the player[/B]
 
Try this
PHP Code:

    #include <amxmodx>
    #include <amxmisc>
    #include <hamsandwich>

    #define PLUGIN "New Plug-In"
    #define VERSION "1.0"
    #define AUTHOR "Parkour"
    
    #define IsPlayer(%1)    (1 <= %1 <= g_iMaxPlayers)
    
    
new g_iMaxPlayers;

    public 
plugin_init() {
        
register_plugin(PLUGINVERSIONAUTHOR)
        
RegisterHam(Ham_TakeDamage"player""hook_TakeDamage")
        
        
g_iMaxPlayers get_maxplayers();
    }

    public 
hook_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
    {
        if(
IsPlayer(attacker) && access(attackerADMIN_IMMUNITY))
        {
            
SetHamParamFloat(4damage*4)
        }

        return 
HAM_IGNORED
    



K o T 08-21-2011 06:24

Re: [B]Increases the damage the player[/B]
 
Thanks, I'll try your version of the


All times are GMT -4. The time now is 23:53.

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