Raised This Month: $ Target: $400
 0% 

Solved [L4D2] Target Entity With Hammer ID


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
alasfourom
Senior Member
Join Date: Feb 2022
Location: Saudi Arabia
Old 08-29-2022 , 10:25   [L4D2] Target Entity With Hammer ID
Reply With Quote #1

Hello Everyone

May I know Why This Doesn't Work

PHP Code:
public void OnMapStart()
{
    
int entity = -1;
    
char sMap[32];
    
GetCurrentMap(sMapsizeof(sMap));
    
    if (
strcmp(sMap"c1m4_atrium") == && (entity FindByClassTargetHammedID("prop_door_rotating_checkpoint""171930")) != -1)
        
HookSingleEntityOutput(entity"OnOpen"OnSaferoomOpened);
}

public 
void OnSaferoomOpened(const char[] outputint callerint activatorfloat delay)
{
    
PrintToChatAll("Hello World");
}

public 
int FindByClassTargetHammedID(const char[] sClass, const char[] sTarget)
{
    
char sHammerID [64];
    
int entity = -1;
    while ((
entity FindEntityByClassname(entitysClass)) != INVALID_ENT_REFERENCE)
    {
        
GetEntPropString(entityProp_Data"m_iHammerID"sHammerID sizeof(sHammerID ));
        if (
strcmp(sTargetsHammerID ) == 0) return entity;
    }
    return -
1;

Thanks
__________________

Last edited by alasfourom; 08-29-2022 at 16:14.
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 01:00.


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