AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Pause a plugin in specific map or Disable (https://forums.alliedmods.net/showthread.php?t=330049)

nG_getwreck 01-18-2021 06:29

Pause a plugin in specific map or Disable
 
Hello, how can I pause a plugin in specific map?

For example:

If map has "ze_" prefix then it will disable zp_gamemode_nemesis.amxx
&&
If map has "de_, cs_ or big_" prefix then it will disable zp_gamemode_multi_infection.amxx

I've also used "configs/maps/plugins-<map prefix>.ini" method but it's more hassle to me.

So I want other method instead of that.

EDIT:
Did try using this:
PHP Code:

    if(containi(map"de_") == -1)
    {
        
pause("ac""zp_gamemode_multi_infection.amxx")
    }
    else if(
containi(map"ze_") == -1) {
        
pause("ac""zp_gamemode_nemesis.amxx")
    }


But it doesn't work.

OciXCrom 01-18-2021 07:13

Re: Pause a plugin in specific map or Disable
 
How is editing multiple lines in a .sma file, recompiling the plugin and replacing it more of a hassle than adding one line in an .ini file?

Quote:

configs/maps/plugins-ze.ini:
zp_gamemode_nemesis.amxx disable

configs/maps/plugins-de.ini:
zp_gamemode_multi_infection.amxx disable
And you're done.

PS: you code doesn't work because you're checking "== -1" instead of "!= -1".

https://amxx-bg.info/api/string/containi

Quote:

Return: -1 on failure (no match found). Any other value indicates a position in the string where the match starts.

nG_getwreck 01-19-2021 20:41

Re: Pause a plugin in specific map or Disable
 
I'll stick with config "configs/maps/%s" method, it doesn't work as it get conflict with zp gamemode manager plugin.

LondoN 01-20-2021 03:04

Re: Pause a plugin in specific map or Disable
 
Code:

if ( containi ( g_map_name, "_de" ) != -1 )
        pause("ac", "plugin.amxx");



All times are GMT -4. The time now is 14:11.

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