hey,
I need some help with a script im creating,
parts of my plugin let admins color players and once those players are colored I dont want them to be able to damage eachother.
currently the segment of the code looks something like
Code:
public void OnPluginStart()
{
HookEvent("player_hurt", PlayerDamaged);
}
public PlayerDamaged(Event event, const char[] name, bool dontBroadcast)
{
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
new victim = GetClientOfUserId(GetEventInt(event, "victim"));
if(GetEntSendPropOffs(attacker, "m_clrRender") == GetEntSendPropOffs(victim,"m_clrRender"))
{
//set damage to 0?
}
}
I want the victim to take no damage from the attacker if they are the same color, though I believe the code above will not work as intended, any suggestions?