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
sorallll
Senior Member
Join Date: Oct 2018
Old 11-10-2022 , 18:40   Re: [L4D2] How to detect if tank/witch are already on fire?
Reply With Quote #2

Quote:
Originally Posted by alasfourom View Post
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;

PHP Code:
GetEntityFlags(entity) & FL_ONFIRE 
sorallll 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