AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Unlock elevator trigger (https://forums.alliedmods.net/showthread.php?t=330836)

Gold Fish 02-23-2021 04:49

Unlock elevator trigger
 
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?

Gold Fish 02-23-2021 05:01

Re: Unlock elevator trigger
 
to unblock the button I also use this plugin trigger.sp
wat such a command
PHP Code:

!trigger elevator_button unlock 


Silvers 02-23-2021 05:32

Re: Unlock elevator trigger
 
Quote:

Originally Posted by Gold Fish (Post 2737932)
I tried to manually start the elevator triggers with this plugin
still does not go. what could be the problem?

The plugin still works for c8m4 so I don't know what's wrong. Look at the plugin and the elevator name, or use Stripper:Source to dump the maps entity properties.

Gold Fish 02-23-2021 05:43

Re: Unlock elevator trigger
 
Quote:

Originally Posted by Silvers (Post 2737935)
The plugin still works for c8m4 so I don't know what's wrong. Look at the plugin and the elevator name, or use Stripper:Source to dump the maps entity properties.

https://drive.google.com/file/d/19Ay...ew?usp=sharing

Marttt 02-23-2021 08:53

Re: Unlock elevator trigger
 
1 Attachment(s)
You should attach the .txt file in the post. Your sharing is requesting access.

Btw this entity on c8m4 has a trigger multiple that locks it again if not everybody is inside the elevator.

PHP Code:

{
"model" "*40"
"wait" "1"
"StartDisabled" "0"
"spawnflags" "1"
"origin" "13432 15273.8 484.54"
"entireteam" "2"
"allowincap" "1"
"classname" "trigger_multiple"
"hammerid" "1199298"
"OnEntireTeamStartTouch" "elevator_button,Unlock,,0,-1"
"OnEntireTeamEndTouch" "elevator_button,Lock,,0,-1"


Try adding a filter to your c8m4_interior.cfg file inside stripper/maps folder.

PHP Code:

filter:
{
"classname" "trigger_multiple"
"hammerid" "1199298"



Gold Fish 02-23-2021 10:40

Re: Unlock elevator trigger
 
Marttt, Thanks for the answer, I'm trying to make sure that after trying to press the elevator buttons, a timer is activated, after which the button will be unlocked and the elevator will go. If you remove the lock through the stripper, it will be difficult to check that all players are in the elevator, I unlock the elevator button with the command !trigger elevator_button unlock (manual method) (
plugin for managing triggers
) and sometimes this part of the elevator doors do not close to the end and the elevator does not go anywhere, no activations triggers no longer help to move the elevator, I do not yet understand what is breaking the elevator, because I just unlock the panel. Other plugins don't seem to conflict.
Also, sometimes the problem occurs with other elevators and only when there are a lot of people on the server

sorry for my English

Marttt 02-23-2021 10:52

Re: Unlock elevator trigger
 
Well, seem that you made some custom event on this button, maybe you should describe it more.
At first, I thought that you were just trying to unlock the button.

Gold Fish 02-23-2021 15:18

Re: Unlock elevator trigger
 
1 Attachment(s)
This plug-in starts a timer for 10 seconds after activating the elevator button, then the button will be unlocked, Sometimes it didn’t work and the elevator didn’t move and players get stuck on the map

Gold Fish 02-27-2021 16:06

Re: Unlock elevator trigger
 
Quote:

Originally Posted by Silvers (Post 2737935)
The plugin still works for c8m4 so I don't know what's wrong. Look at the plugin and the elevator name, or use Stripper:Source to dump the maps entity properties.

it seems the problem was in this plugin The New Weapon:Defibrillator
, most of the bugs occur when using the defibrillator, maybe that code somehow harms the triggers?


Could it be due to misuse of the hook? in SM1.10?

PHP Code:

        SDKUnhook(clientSDKHook_PreThink ClientThink);
        
SDKHook(clientSDKHook_PreThink ClientThink); 


Maybe these hooks are very dangerous for triggers and should be unhooked on map with triggers?

Gold Fish 03-03-2021 05:59

Re: [Solved] Unlock elevator trigger
 
Found the reasons why the elevators stopped functioning, thanks to honorcode23
https://forums.alliedmods.net/showpo...8&postcount=15


All times are GMT -4. The time now is 16:19.

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