Raised This Month: $51 Target: $400
 12% 

Some manipulations with friendly fire..


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 10-09-2018 , 09:28   Some manipulations with friendly fire..
Reply With Quote #1

I have this code, but it doesn't work... I have no idea why. Is something wrong with me?



PHP Code:
public void OnClientPutInServer(int client

    
SDKHook(clientSDKHook_OnTakeDamageHook_OnTakeDamage);
}
public 
Action Hook_OnTakeDamage(int victimintattackerintinflictorfloatdamageintdamagetype
{
    if(
ValidPlayer(victim) && ValidPlayer(attacker))
    {
        if(
GetClientTeam(attacker) == GetClientTeam(victim))
        {
            
int heal 20;
            
int oldhp GetClientHealth(victim);
            
            if(
oldhp heal 100)
            {
                
SetEntityHealth(victim,100);
            }
            else
            {
                
SetEntityHealth(victimheal oldhp);
            }
            
            
PrintToChat(attacker"You healed your teammate!");
            
PrintToChat(victim"Your teammate healed you!");
        }
    }
    return 
Plugin_Continue;


Last edited by impossible_cc; 10-09-2018 at 13:41.
impossible_cc 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 15:44.


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