AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Load/Unload Plugin for specific maps (https://forums.alliedmods.net/showthread.php?t=88707)

endeffects 03-28-2009 09:52

Load/Unload Plugin for specific maps
 
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

Owyn 03-28-2009 10:14

Re: Load/Unload Plugin for specific maps
 
Code:

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

            if ( equali( szMapName, "de_dust" ) )
            {
              return;
            }


ConnorMcLeod 03-28-2009 10:16

Re: Load/Unload Plugin for specific maps
 
Use per maps plugins-ini files, read amxx documentation, you can enable/disable plugins on specifics maps and on specific prefixed maps.

Lo6idZe 03-28-2009 10:36

Re: Load/Unload Plugin for specific maps
 
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")
}


ConnorMcLeod 03-28-2009 10:45

Re: Load/Unload Plugin for specific maps
 
You don't need to execute some code in a plugin to load/disable it in a map, RTFD.

endeffects 03-28-2009 10:45

Re: Load/Unload Plugin for specific maps
 
oh wonderfull thanks alot for all your comments and help.

have a nice weekend =)

ILUSION 03-28-2009 20:36

Re: Load/Unload Plugin for specific maps
 
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"

ConnorMcLeod 03-29-2009 06:16

Re: Load/Unload Plugin for specific maps
 
Quote:

Originally Posted by ILUSION (Post 791726)
Create de_dust2.cfg

:nono::nono:

configs/maps/plugins-dust2.ini

ILUSION 03-29-2009 18:21

Re: Load/Unload Plugin for specific maps
 
Quote:

Originally Posted by ConnorMcLeod (Post 791992)
:nono::nono:

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

Arkshine 03-29-2009 18:47

Re: Load/Unload Plugin for specific maps
 
No, since 1.8.0.


All times are GMT -4. The time now is 00:12.

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