Raised This Month: $ Target: $400
 0% 

Depleting armor bot issue


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 06-16-2011 , 16:01   Depleting armor bot issue
Reply With Quote #1

So, I want to make a plugin where the armor is depleted before health in cs 1.6. I have made this:

PHP Code:
#include <amxmodx>
#include <csx>
#include <fun>

public plugin_init()
{
    
register_plugin("Deplete armor before health""1.0""Jelle")
}

public 
client_damage(attackervictimdamage)
{
    
client_print(victimprint_chat"client_damage forward has run")
    
//if damage is bigger than armor
    
new armor get_user_armor(victim)
    if ( 
damage armor )
    {
        
client_print(victimprint_chat"Damage is now bigger than armor")
        
//first calculate how much life to deplete
        
new depleteHealth damage armor
        
        
//set armor to 0
        
set_user_armor(victim0)
        
        
//then deplete the life
        
set_user_health(victimget_user_health(victim) - depleteHealth)
    }
    
    
//if armor is bigger than damage
    
else if ( armor damage )
    {
        
client_print(victimprint_chat"Damage is now lower than armor")
        
//deplete armor with the damage taken
        
set_user_armor(victimarmor damage)
        
        
//remember to give the health back
        
set_user_health(victimget_user_health(victim) + damage)
    }
    
    
//any other case
    
else
    {
        
//do nothing
        
return
    }

The reason why I am asking here is because it works very well for me (not on fall damage since client_damage doesn't run on fall damage apparently), but the bots I am playing with on my server, they just die instantly once I shoot them. Is this just a problem with the bots or my code?
As you can see I have added a few client_print for debugging (I forgot get_user_health() in set_user_health so it would set the damage as health).
Anyone?
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Reply



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 23:29.


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