Code:
#include <amxmodx>
new Trie:PausePlugins
// these plugins will be disabled on a public server
new public_settings[][] = {
"Weapon Health",
"Migraine",
"Restrict Kills 1.1",
"Admin Hierarchy"
}
// these plugins will be disabled on a lan server
new local_settings[][] = {
"Country On Name",
"HLTV Autorecord",
"AMX SlayAll v1.7",
"Only admins can drop weapons! v1.1"
}
new iPluginsNum
public plugin_cfg(){
PausePlugins = TrieCreate()
iPluginsNum = get_pluginsnum()
if (is_dedicated_server())
settings("Public", public_settings)
else
settings("Local", local_settings)
}
public plugin_end()
TrieDestroy(PausePlugins)
settings(type[], pause_list[][]){
for (new i; i < sizeof(pause_list); i++)
TrieSetCell(PausePlugins, pause_list[i], 1)
new filename[32], name[32], run;
for (new j; j < iPluginsNum; j++){
get_plugin(j, filename, charsmax(filename), name, charsmax(name))
if (TrieKeyExists(PausePlugins, name)){
if (is_plugin_loaded(filename, true)){
run = pause("a", filename)
if (run)
server_print("%s Settings: %s (%s) paused", type, name, filename)
else
server_print("%s Settings: %s (%s) could not be paused", type, name, filename)
}
else
server_print("%s Settings: %s (%s) already disabled, skipping", type, name, filename)
TrieDeleteKey(PausePlugins, name)
}
server_print("%s does not match %s from id(%d), skipping", pause_list[j], name, j)
}
}