AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   block cnagelevel command (https://forums.alliedmods.net/showthread.php?t=174164)

verzoteX 12-16-2011 10:11

block cnagelevel command
 
can anybody tell me how to block changelevel command in my server becouse i run only dd2 server and dont whant to change maps :)

echo_cs 12-16-2011 10:28

Re: block cnagelevel command
 
1 Attachment(s)
This is The plugin

I created it for you

PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "echo_cs"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_cvar("map_only""1")
    
register_cvar("map_onlyname""de_dust2")
    
server_cmd("mp_timelimit 0")
}



public 
server_changelevel()
{
    new 
Map[50];
    
    if(!
get_cvar_num("map_only") )
        return 
PLUGIN_CONTINUE
    
    
if(!get_cvar_string("map_onlyname"Mapcharsmax(Map) ) )
        return 
PLUGIN_CONTINUE
    
    server_cmd
("amx_map %s"Map);
    
    
server_cmd("mp_timelimit 0")
    
    return 
PLUGIN_HANDLED


First: Download the MapOnly.amxx in addons/amxmodx/plugins
Second :Open addons/amxmodx/config/plugin.ini and add this MapOnly.amxx in the end

verzoteX 12-16-2011 10:31

Re: block cnagelevel command
 
Quote:

Originally Posted by echo_cs (Post 1614156)
This is The plugin

I created it for you

PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "echo_cs"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_cvar("map_only""1")
    
register_cvar("map_onlyname""de_dust2")
    
server_cmd("mp_timelimit 0")
}



public 
server_changelevel()
{
    new 
Map[50];
    
    if(!
get_cvar_num("map_only") )
        return 
PLUGIN_CONTINUE
    
    
if(!get_cvar_string("map_onlyname"Mapcharsmax(Map) ) )
        return 
PLUGIN_CONTINUE
    
    server_cmd
("amx_map %s"Map);
    
    
server_cmd("mp_timelimit 0")
    
    return 
PLUGIN_HANDLED


First: Download the MapOnly.amxx in addons/amxmodx/plugins
Second :Open addons/amxmodx/config/plugin.ini and add this MapOnly.amxx in the end


edit: i tested it but it doesent block command changelevel it just sets mp_timelimit to 0 i whant a plugin what blocks changelevel and rcon map commands if possible

echo_cs 12-16-2011 10:37

Re: block cnagelevel command
 
The plugin has an error Please wait

echo_cs 12-16-2011 10:45

Re: block cnagelevel command
 
you can Do this

you deleted all the .bsp files in cstrike/map only de_dust2.bsp

And wait the plugin is difficalt

verzoteX 12-16-2011 10:50

Re: block cnagelevel command
 
Quote:

Originally Posted by echo_cs (Post 1614168)
you can Do this

you deleted all the .bsp files in cstrike/map only de_dust2.bsp

And wait the plugin is difficalt

i tried that too but i have a plugin that changes the map after 30 rounds and if no maps in map folder my server crashs so i have to block the command so the plugin cant change it and i cant delete the plugin becouse becouse i created my server for that mode :(

Devil259 12-16-2011 11:37

Re: block cnagelevel command
 
Delete others maps / Use mp_timelimit 0

ConnorMcLeod 12-16-2011 11:41

Re: block cnagelevel command
 
Quote:

Originally Posted by verzoteX (Post 1614172)
i have a plugin that changes the map after 30 rounds

And first idea you have is to block changelevel command ? :shock::shock:

verzoteX 12-16-2011 11:42

Re: block cnagelevel command
 
Quote:

Originally Posted by ConnorMcLeod (Post 1614201)
And first idea you have is to block changelevel command ? :shock::shock:

yes if possible i searched for that plugin months a can fix that in other ways but i want to block it :D

Devil259 12-16-2011 12:49

Re: block cnagelevel command
 
You can test that even if it's useless to install a plugin to do what you want ...

Code:
#include < amxmodx > public plugin_init( ) {      register_concmd( "changelevel" , "fwChangeLevel" ); } public fwChangeLevel( ) {     return PLUGIN_HANDLED_MAIN; }

I don't know if that can works.


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

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