AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Pause/Unpause sourcemod plugins (https://forums.alliedmods.net/showthread.php?t=324201)

safetymoose 05-09-2020 09:55

Pause/Unpause sourcemod plugins
 
AMXX has functions that can pause/unpause plugins allowing for certain plugins to be loaded when needed and unloaded when not. Does sourcemod have equivalent functions?

Bacardi 05-09-2020 10:19

Re: Pause/Unpause sourcemod plugins
 
...no?

You can do it with cvar
or sm plugins unload/load

*edit
or https://wiki.alliedmods.net/Function...Mod_Scripting)

safetymoose 05-09-2020 10:32

Re: Pause/Unpause sourcemod plugins
 
Quote:

Originally Posted by Bacardi (Post 2699043)
...no?

That's so weird. I found this in the include
PHP Code:

/**
 * Called when the plugin's pause status is changing.
 *
 * @param pause         True if the plugin is being paused, false otherwise.
 */
forward void OnPluginPauseChange(bool pause); 

But i dont see a way to change the plugin's pause status.

Quote:

Originally Posted by Bacardi (Post 2699043)
You can do it with cvar
or sm plugins unload/load

Would ServerCommand() do the trick here? I guess it should work, but it's gonna look crude.

Quote:

Originally Posted by Bacardi (Post 2699043)

I'm familiar with natives and forwards, they have a different purpose tho.

safetymoose 05-09-2020 11:01

Re: Pause/Unpause sourcemod plugins
 
Quote:

Originally Posted by Bacardi (Post 2699043)
sm plugins unload/load

I guess i'll have to go with that, unless there's a better way.

Bacardi 05-09-2020 11:50

Re: Pause/Unpause sourcemod plugins
 
Dunno, what purpose that OnPluginPauseChange. Could it be in those "benchmarks"

*edit
read from hear, https://github.com/alliedmodders/sou...inSys.cpp#L584

*edit
could be it for extension ?

safetymoose 05-09-2020 14:15

Re: Pause/Unpause sourcemod plugins
 
I think it's not implemented(yet).

https://github.com/alliedmodders/sou...re.inc#L86-L87

I'm gonna stick to the method you posted. Thanks.

Fyren 05-09-2020 17:04

Re: Pause/Unpause sourcemod plugins
 
Quote:

Originally Posted by safetymoose (Post 2699089)
I think it's not implemented(yet).

The opposite. Pausing was removed a few years ago.


All times are GMT -4. The time now is 17:02.

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