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

How to block some commands on a Specific map?


Post New Thread Reply   
 
Thread Tools Display Modes
bibu
Veteran Member
Join Date: Sep 2010
Old 03-14-2012 , 14:42   Re: How to block some commands on a Specific map?
Reply With Quote #11

Quote:
Originally Posted by Xvil View Post
Test This:
[PHP]...
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 03-14-2012 , 14:50   Re: How to block some commands on a Specific map?
Reply With Quote #12

Quote:
Originally Posted by bibu View Post
__________________
kramesa is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-14-2012 , 14:55   Re: How to block some commands on a Specific map?
Reply With Quote #13

PHP Code:
#include <amxmodx>

public plugin_init() {
    
register_clcmd("say /pro15""block")
    
register_clcmd("say /top15""block")
    
register_clcmd("say /nub15""block")
}

public 
block(id)
{
    
client_print(idprint_chat"This command it's blocked.")
    return 
PLUGIN_HANDLED

Now just put that plugin in the proper plugins.ini for the maps you want it enabled.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 03-14-2012 , 16:28   Re: How to block some commands on a Specific map?
Reply With Quote #14

Quote:
Originally Posted by Exolent[jNr] View Post
PHP Code:
#include <amxmodx>

public plugin_init() {
    
register_clcmd("say /pro15""block")
    
register_clcmd("say /top15""block")
    
register_clcmd("say /nub15""block")
}

public 
block(id)
{
    
client_print(idprint_chat"This command it's blocked.")
    return 
PLUGIN_HANDLED

Now just put that plugin in the proper plugins.ini for the maps you want it enabled.
still not working :S

maybe i need delete this commands in kreedz plugin and compile it with another name and enable it only for longjumps maps
bazhenov93 is offline
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 03-14-2012 , 16:31   Re: How to block some commands on a Specific map?
Reply With Quote #15

BUT would be nice if

Quote:
new const rmaps[][] =
{
"kz_longjumps2",
"kzlt_weridjumps"
}
by killergirl

but i tried and not working
bazhenov93 is offline
Xvil
BANNED
Join Date: Feb 2012
Old 03-14-2012 , 17:13   Re: How to block some commands on a Specific map?
Reply With Quote #16

Quote:
Originally Posted by Xvil View Post
Test This:
PHP Code:
#include <amxmodx>
#include <amxmisc>

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

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /pro15""block")
    
register_clcmd("say /top15""blcok")
    
register_clcmd("say /nub15""block")
}

public 
block(id)
{
    static 
Map[50]
    
    
get_mapname(Mapcharsmax(Map))
    
    if(
equal(Map,"kzlt_weridjumps") || equal(Map,"kz_longjumps2") )
    {
      
client_print(idprint_chat"This command it's blocked.")
      return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE

Test this i'm shure that will work

Last edited by Xvil; 03-15-2012 at 13:51.
Xvil is offline
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 03-14-2012 , 17:22   Re: How to block some commands on a Specific map?
Reply With Quote #17

Quote:
Originally Posted by Xvil View Post
Test this i'm shure that will work
Error: Undefined symbol "map" on line 20
bazhenov93 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-14-2012 , 17:35   Re: How to block some commands on a Specific map?
Reply With Quote #18

Quote:
Originally Posted by Xvil View Post
Test this i'm shure that will work
It's also poorly coded.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 03-15-2012 , 06:54   Re: How to block some commands on a Specific map?
Reply With Quote #19

The first solution is the solution given by Exolent :
- Create a "maps" folder in ./configs/.
- Put the plugin which block the command in plugins-mapname.ini (replace mapname by map's name).
- Put plugins-mapname.ini in ./configs/maps/

The second solution is this one :

Code:
#include < amxmodx > new const g_szMaps[ ][ ] = {     "kz_longjumps2",     "kzlt_weridjumps" } public plugin_init() {     new szMapName[ 32 ];     for( new i = 0; i < sizeof( g_szMaps ); i++ )     {         get_mapname( szMapName, 31 );         if( equal( szMapName, g_szMaps[ i ] ) )         {             register_clcmd( "say /pro15", "block" );             register_clcmd( "say /top15", "block" );             register_clcmd( "say /nub15", "block" );         }     } } public block( id ) {     client_print( id, print_chat, "This command it's blocked." )     return PLUGIN_HANDLED; }

and put this plugin above kz plugin.

As far as I know, the first solution is better.
__________________
You can do anything you set your mind to, man.


Last edited by Devil259; 03-15-2012 at 06:55.
Devil259 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-15-2012 , 09:39   Re: How to block some commands on a Specific map?
Reply With Quote #20

Devil almost had it right.

Code:
#include < amxmodx > new const g_szMaps[ ][ ] = {     "kz_longjumps2",     "kzlt_weridjumps" } public plugin_init() {     new szMapName[ 32 ];
    get_mapname( szMapName, 31 ); // moved out of loop
        for( new i = 0; i < sizeof( g_szMaps ); i++ )     {         if( equal( szMapName, g_szMaps[ i ] ) )         {             register_clcmd( "say /pro15", "block" );             register_clcmd( "say /top15", "block" );             register_clcmd( "say /nub15", "block" );            
            break; // no need to check other maps if we found a match
        }     } } public block( id ) {     client_print( id, print_chat, "This command it's blocked." )     return PLUGIN_HANDLED; }

A plugin checking the map is actually the only solution because it has to be put at the top of the plugins.ini.
You can't set it at the top with per-map plugins.ini files.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 23:11.


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