AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Damage Money (https://forums.alliedmods.net/showthread.php?t=318171)

Shader62 08-18-2019 02:06

Damage Money
 
I would like when you shoot through the wall not to give you money


Code:


#include < amxmodx >
#include < hamsandwich>
#include < cstrike >
#include < biohazard >

new const PLUGIN_NAME[  ] = "[Bio] Damage Money (Chance)",
        PLUGIN_VERSION[  ] = "1.0",
        PLUGIN_AUTHOR[  ] = "Dias";

const CHANCE = 30;

public plugin_init(  ) {

        register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
        is_biomod_active(  ) ? plugin_init2(  ) : pause( "ad" );
}

public plugin_init2(  ) {

        RegisterHam(Ham_TakeDamage, "player", "fw_take_damage")
}

public fw_take_damage(victim, inflictor, attacker, Float:damage, damagebits)
{
        if(!is_user_connected(victim) || !is_user_connected(attacker))
                return HAM_IGNORED
       
        if(is_user_zombie(attacker) || !is_user_zombie(victim))
                return HAM_IGNORED
               
        if(damage == 0.0)
                return HAM_IGNORED

        new Chance = random_num( 1, 100 );

        if( Chance > 0 && Chance <= CHANCE ) {
                cs_set_user_money( attacker, cs_get_user_money( attacker ) + floatround( damage ) );
        } else {
                return HAM_HANDLED;
        }
               
        return HAM_HANDLED
}


OciXCrom 08-18-2019 07:58

Re: Damage Money
 
Quote:

Originally Posted by Shader62 (Post 2663671)
???

What? You expect someone to do this in just 5 hours? People here can wait up to 5 months and still not get their request made. Don't bump your thread - you're not helping yourself, you just lower your chances of someone helping you.


All times are GMT -4. The time now is 03:46.

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