Thread: dmg molotov
View Single Post
Ejziponken
AlliedModders Donor
Join Date: Apr 2008
Old 11-14-2019 , 15:38   Re: dmg molotov
Reply With Quote #3

Quote:
Originally Posted by Ilusion9 View Post
PHP Code:

#include <sourcemod> 
#include <sdktools> 
#include <sdkhooks> 

public OnClientPutInServer(int client

    
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage); 


public 
Action OnTakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetypeint &weaponfloat damageForce[3], float damagePosition[3]) 
{
    if (
attacker == victim)
    {
        return 
Plugin_Continue// do self damage
    
}
    
    if (
inflictor != -1// if there are no inflictors, this should be -1, you can remove it if the damage in molotov doesnt work
    
{
        
char weaponName[32]; 
        
GetEdictClassname(inflictorweaponNamesizeof(weaponName)); 
        
        if (
StrEqual(weaponName"inferno"false))
        {
            return 
Plugin_Continue// do damage in molotov
        
}
    }
    
    if (
IsValidClient(victim))
    {
        if (
IsValidClient(attacker))
        {
            if (
GetClientTeam(attacker) == GetClientTeam(victim))
            {
                return 
Plugin_Handled// stop friendly fire, except molotovs
            
}
        }
    }
    
    return 
Plugin_Continue
}

bool IsValidClient(int client)
{
    if (
client || client MaxClients)
    {
        return 
false;
    }
    
    return 
IsClientInGame(client);

Cant make this work. If I sett FF on, then team can kill eachother and if I set it off, then molotovs dont do damage.
Ejziponken is offline