Thread: dmg molotov
View Single Post
paulo_crash
AlliedModders Donor
Join Date: May 2016
Location: Brazil
Old 02-06-2020 , 09:17   Re: dmg molotov
Reply With Quote #4

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);

I will be doing the test with this version, but from what I could see it is only with molotovs.

Someone would have one that does damage with all the grenades in the game, except the shot.

I tried this, but same problem, except that apparently I realized that the explosion of the C4 is not keeping players...

https://forums.alliedmods.net/showthread.php?t=301081
paulo_crash is offline