AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   small request about money and hp for kills (https://forums.alliedmods.net/showthread.php?t=173774)

lqlqlq 12-10-2011 10:30

small request about money and hp for kills
 
I need this:

When admin killing without headshot (admin with flag ADMIN_LEVEL_G), give:
500 money and +50hp

When admin killing with headshot (admin with flag ADMIN_LEVEL_G), give:
1000 money and +70hp

Thanks!

Larcyn 12-10-2011 11:00

Re: small request about money and hp for kills
 
PHP Code:

#include <amxmodx>
#include <cstrike>
#include <fun>

public plugin_init() 
{
    
register_plugin("Admin Extra Money""1.0.0""Larcyn")
    
register_event("DeathMsg""Event_DeathMsg""a")
}

public 
Event_DeathMsg()
{
    new 
iKiller read_data(1)
    new 
iVictim read_data(2)
    new 
iHs read_data(3)
    
    if(
cs_get_user_team(iKiller) == cs_get_user_team(iVictim) || (!get_user_flags(iKiller) && ADMIN_LEVEL_G))
        return 
PLUGIN_HANDLED
    
    
if(is_user_alive(iKiller))
    {
        
cs_set_user_money(iKillercs_get_user_money(iKiller) + (iHs) ? 1000 500)
        
set_user_health(iKillerget_user_health(iKiller) + (iHs) ? 70 50)
    }
    return 
PLUGIN_CONTINUE


Untested.

lqlqlq 12-12-2011 01:39

Re: small request about money and hp for kills
 
Admin flag not working - added hp to all players.
Have one more bug, when kill and get hp, your hp is replaced by defined in sma.
When have 100 hp, you not give 170 when kill someone with hs, you give 70 (replaced).
This is and for the money (bugged too).

Please fix.


All times are GMT -4. The time now is 20:52.

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