Quote:
Originally Posted by Ilusion9
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
public OnClientPutInServer(int client)
{
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}
public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype, int &weapon, float 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(inflictor, weaponName, sizeof(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 < 1 || 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