View Single Post
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 04-16-2021 , 14:15   Re: [DEV] Autoreload plugins
Reply With Quote #17

Updated.

Quote:
1.11 (16-Apr-2021)
- Added TIMER_FLAG_NO_MAPCHANGE to prevent accidentally plugin double reload on map change.
- Added forwards (thanks to Silvers for request):

* AP_OnPluginUpdate - called when plugin list update sequence is about to start (or ended) - see the "pre" argument to determine.
> This happens when 1 or more plugins are to be planned for loading/reloading/unloading.
> Example: when 10 plugins are changed simultaneously, this forward is called 2 times: 1 - very first before all other forward, then 2 - it is called as last, after all other forwards.
* AP_OnPluginLoad - called before and after plugin is loaded (no matter successfully or not - see the "pre" and "status" arguments for details).
> This happens when plugin wasn't loaded yet, or its previous loading failed.
* AP_OnPluginReload - called before and after plugin is reloaded (no matter successfully or not - see the "pre" and "status" arguments for details).
> This happens when plugin is already loaded at the moment.
* AP_OnPluginUnload
> This happens when plugin is removed, moved or renamed from its initial location.
* Notice 1: You can prevent plugins from load/reload/unload by returning Plugin_Stop in forward (it is only applicable for actions done directly by this plugin).
* Notice 2: these forwards doesn't report about actions made by other plugins including sourcemod itself, like:
> when you manually load/reload/unload plugin via console;
> when SM load/reload/unload plugin between OnMapEnd and OnMapStart events.
About forwards:

- See details in scripting/include/autoreload.inc
- See examples in scripting/include/test_forwards.sp
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 04-16-2021 at 14:20.
Dragokas is offline