Raised This Month: $ Target: $400
 0% 

small request about money and hp for kills


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lqlqlq
Senior Member
Join Date: Jan 2008
Old 12-10-2011 , 10:30   small request about money and hp for kills
Reply With Quote #1

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!
lqlqlq is offline
Larcyn
Senior Member
Join Date: Oct 2010
Old 12-10-2011 , 11:00   Re: small request about money and hp for kills
Reply With Quote #2

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.
__________________

Taking private requests, PM me for information.
Selling HideNSeek & Jailbreak plugins.

Selling Achievement API System (PHP &
MySQL / nVault)

Last edited by Larcyn; 12-10-2011 at 11:07. Reason: Optimized
Larcyn is offline
lqlqlq
Senior Member
Join Date: Jan 2008
Old 12-12-2011 , 01:39   Re: small request about money and hp for kills
Reply With Quote #3

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.
lqlqlq is offline
Reply


Thread Tools
Display Modes

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 20:52.


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