Raised This Month: $ Target: $400
 0% 

If damaged teammate more then 100 or 50 HP, print a message


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 08-06-2011 , 07:37   If damaged teammate more then 100 or 50 HP, print a message
Reply With Quote #1

Hey guys, I did a script, just like the title says, and hooked it up as a HAM, and for some wierd reason, after g_IsStarted is being set to true, when someone shoots his teammate's leg, which is way less than 100 or 50 HP, it is printing both messages at the same time, and for some reason it detects that the damage the player did to his teammates (which is stored in g_LeftKills) is more than 100.... someone can see the bug?

PHP Code:
public tk(victiminflictorkillerdamagebits)
{
    if (
killer == victim)
    {
        
damage 0
    
}
    
    if (
g_IsStarted)
    {
        if ((
cs_get_user_team(killer) == cs_get_user_team(victim)))
        {
            new 
temp
            
            
if (g_LeftKills[killer] >= 100)
            {
                
temp 1
            
}
            
            if (
temp != 1)
            {
                
g_LeftKills[killer] += damage
            
                
if (g_LeftKills[killer] > 50)
                {
                    
client_print(killerprint_chat"%s Warning! Attacking your teammates can get you banned."PREFIX)
                }
            
                if (
g_LeftKills[killer] >= 100)
                {
                    new 
nameofp[50]
                
                    
get_user_name(killernameofp49)
                    
client_print(0print_chat ,"%s  If %s is team attacking just to be annoying, use .voteban"PREFIXnameofp)
                }
            }
        }
    }
    
    return 
PLUGIN_CONTINUE

Here is the register:

PHP Code:
RegisterHam(Ham_TakeDamage"player""tk"
Also, at public client_connect, g_leftkills of a user is being set to 0, so its not a pervious set...
Diegorkable is offline
 



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 03:28.


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