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

Unlock elevator trigger


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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 20:15.


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