Raised This Month: $51 Target: $400
 12% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
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
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
alasfourom
Senior Member
Join Date: Feb 2022
Location: Saudi Arabia
Old 11-11-2022 , 06:40   Re: [L4D2] How to detect if tank/witch are already on fire?
Reply With Quote #3

Ahh thank you sorallll
__________________
alasfourom is offline
Reply



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 10:31.


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