Raised This Month: $32 Target: $400
 8% 

Pause a plugin in specific map or Disable


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nG_getwreck
Senior Member
Join Date: Oct 2020
Location: Philippines from South K
Old 01-18-2021 , 06:29   Pause a plugin in specific map or Disable
Reply With Quote #1

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.
__________________

Last edited by nG_getwreck; 01-18-2021 at 06:30.
nG_getwreck is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-18-2021 , 07:13   Re: Pause a plugin in specific map or Disable
Reply With Quote #2

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.
__________________

Last edited by OciXCrom; 01-18-2021 at 07:14.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
nG_getwreck
Senior Member
Join Date: Oct 2020
Location: Philippines from South K
Old 01-19-2021 , 20:41   Re: Pause a plugin in specific map or Disable
Reply With Quote #3

I'll stick with config "configs/maps/%s" method, it doesn't work as it get conflict with zp gamemode manager plugin.
__________________

Last edited by nG_getwreck; 01-19-2021 at 20:41.
nG_getwreck is offline
LondoN
Senior Member
Join Date: Dec 2015
Location: Roman, Romania.
Old 01-20-2021 , 03:04   Re: Pause a plugin in specific map or Disable
Reply With Quote #4

Code:
if ( containi ( g_map_name, "_de" ) != -1 )
	pause("ac", "plugin.amxx");
__________________
LondoN is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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