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) + 1 : 64;
// Go through the entries from the start until the limit is reached.
for (int i = Start + 1; i < MaxEntities ; i++)
{
// If the entity is invalid, skip to the next entity.
if (!IsValidEntity(i))
continue;
// Get the entity's name to compare.
GetEntPropString(i, Prop_Data, "m_iName", TempName, 64);
// We use strncmp since it allows to limit the length of the search,
// in case the "*" is present.
if (strncmp(Name, TempName, StringLimit, false) == 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?