Raised This Month: $ Target: $400
 0% 

[L4D2] How to detect if tank/witch are already on fire?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
alasfourom
Senior Member
Join Date: Feb 2022
Location: Saudi Arabia
Old 11-10-2022 , 18:18   [L4D2] How to detect if tank/witch are already on fire?
Reply With Quote #1

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[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));
    if (!
client || !IsClientInGame(client) || IsFakeClient(client) || GetClientTeam(client) != 2) return;
    
    
char sVictimName[32];
    
GetEventString(event"victimname"sVictimNamesizeof(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;

__________________

Last edited by alasfourom; 11-10-2022 at 18:25.
alasfourom is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:59.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode