Raised This Month: $12 Target: $400
 3% 

Load/Unload Plugin for specific maps


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
endeffects
Senior Member
Join Date: Nov 2007
Old 03-28-2009 , 09:52   Load/Unload Plugin for specific maps
Reply With Quote #1

Hallo,

i'd like to unload one of my plugins when some specific maps are started.
does anyone have an idea how to do this?

regards
__________________
Get rid of all these fake, spam, redirect servers
on your steam server list!
endeffects is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 03-28-2009 , 10:14   Re: Load/Unload Plugin for specific maps
Reply With Quote #2

Code:
new szMapName[32];
    get_mapname( szMapName, 32 );

            if ( equali( szMapName, "de_dust" ) )
            {
               return;
            }
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-28-2009 , 10:16   Re: Load/Unload Plugin for specific maps
Reply With Quote #3

Use per maps plugins-ini files, read amxx documentation, you can enable/disable plugins on specifics maps and on specific prefixed maps.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Lo6idZe
Member
Join Date: May 2008
Old 03-28-2009 , 10:36   Re: Load/Unload Plugin for specific maps
Reply With Quote #4

Code:
#include <amxmodx>

new const PLUGIN[] = "Nothing"
new const VERSION[] = "0.0"
new const AUTHOR[] = "Lo6idZe(KIL)"

public plugin_init() 
{
        register_plugin(PLUGIN, VERSION, AUTHOR)
    
        new mapname[32]
        get_mapname(mapname,31)
        
        if(equali(mapname,"yourmap"))
        server_cmd("amxx pause plugname") 
}
Lo6idZe is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-28-2009 , 10:45   Re: Load/Unload Plugin for specific maps
Reply With Quote #5

You don't need to execute some code in a plugin to load/disable it in a map, RTFD.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
endeffects
Senior Member
Join Date: Nov 2007
Old 03-28-2009 , 10:45   Re: Load/Unload Plugin for specific maps
Reply With Quote #6

oh wonderfull thanks alot for all your comments and help.

have a nice weekend =)
__________________
Get rid of all these fake, spam, redirect servers
on your steam server list!
endeffects is offline
ILUSION
Senior Member
Join Date: Oct 2006
Location: Argentina
Old 03-28-2009 , 20:36   Re: Load/Unload Plugin for specific maps
Reply With Quote #7

Use this: addons/amxmodx/configs/maps (its more easy)

Example:

Create de_dust2.cfg and in the cfg write
amx_pausecfg pause plugin.amxx and save in the folder "maps"
__________________
ILUSION is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-29-2009 , 06:16   Re: Load/Unload Plugin for specific maps
Reply With Quote #8

Quote:
Originally Posted by ILUSION View Post
Create de_dust2.cfg


configs/maps/plugins-dust2.ini
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
ILUSION
Senior Member
Join Date: Oct 2006
Location: Argentina
Old 03-29-2009 , 18:21   Re: Load/Unload Plugin for specific maps
Reply With Quote #9

Quote:
Originally Posted by ConnorMcLeod View Post


configs/maps/plugins-dust2.ini
Mmm, strange, I use hide_n_seek.cfg and in the map hide_n_seek load these cvars:

sv_gravity 330
mp_freezetime 0

and works fine for me, plugins-dust2.ini is for amxx 1.8.1+ ? because I use amxx 1.80
__________________
ILUSION is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-29-2009 , 18:47   Re: Load/Unload Plugin for specific maps
Reply With Quote #10

No, since 1.8.0.
Arkshine is offline
Reply


Thread Tools
Display Modes

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 02:40.


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