View Single Post
Author Message
Gold Fish
Senior Member
Join Date: Mar 2020
Old 02-23-2021 , 04:49   Unlock elevator trigger
Reply With Quote #1

Greetings.
Why, when unlocking the elevator button and after activating the button, the elevator does not run? The bug occurs when there are more than 4-5 people on the server

unblocking like this:

PHP Code:
if (StrEqual(mapName"c8m4_interior"false)) 
{
PrintToChatAll("AcceptEntityInput elevator_button unlock");
Entity FindEntityWildcard("elevator_button");
if (
IsValidEntity(Entity)) AcceptEntityInput(Entity"unlock"client);

}

...
    
int FindEntityWildcard(const char [] Name, const int Start = -1)
{
    
// To hold the name taken from the entity being checked.
    
char TempName[64];
    
    
// First, find the "*" wildcard. If it's present, we truncate the search limit.
    
int StringLimit StrContains(Name"*");
    
    
// If no match is found, reset to the entire length, to include the terminating NULL.
    // There's a sanity check, in case the entity name is malformed.
    
if (StringLimit 0)
        
StringLimit = (strlen(Name) < 64) ? strlen(Name) + 64;
    
    
// Go through the entries from the start until the limit is reached.
    
for (int i Start 1MaxEntities i++)
    {
        
// If the entity is invalid, skip to the next entity.
        
if (!IsValidEntity(i))
            continue;
        
        
// Get the entity's name to compare.
        
GetEntPropString(iProp_Data"m_iName"TempName64);
        
        
// We use strncmp since it allows to limit the length of the search,
        // in case the "*" is present.
        
if (strncmp(NameTempNameStringLimitfalse) == 0)
            
// We have a match. Stop processing and return the match.
            
return i;
    }
    
    
// No match. Return the invalid reference.
    
return INVALID_ENT_REFERENCE;

I tried to manually start the elevator triggers with this plugin
still does not go. what could be the problem?

Last edited by Gold Fish; 02-23-2021 at 04:55.
Gold Fish is offline