Hello guys,
I'm trying to do some stuff when someone has ignited a witch or tank. When trying to hook the "zombie_ignited", this event will keep spamming the stuff I'm trying to do as far as they are on fire.
So how to detect if tank/witch are already on fire?
Thanks
PHP Code:
#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
public void OnPluginStart()
{
HookEvent("zombie_ignited", Event_ZombieIgnited);
}
void Event_ZombieIgnited(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(event.GetInt("userid"));
if (!client || !IsClientInGame(client) || IsFakeClient(client) || GetClientTeam(client) != 2) return;
char sVictimName[32];
GetEventString(event, "victimname", sVictimName, sizeof(sVictimName));
if(StrEqual(sVictimName, "Tank", false)) PrintToChatAll("Tank ignited by: %N", cleint);
else if(StrEqual(sVictimName, "Witch", false)) PrintToChatAll("Witch ignited by: %N", cleint);
return;
}
__________________