AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to block some commands on a Specific map? (https://forums.alliedmods.net/showthread.php?t=180275)

bazhenov93 03-13-2012 09:23

How to block some commands on a Specific map?
 
On kz_longjumps2 // kzlt_weridjumps and longjumps maps, I want to block commans like " pro15 / top15 / nub15 " from kreedz plugin

BECAUSE i have an PLUGIN, that when you type this commands, will show another records...

IT's Possible? THANKS.

kiki33hun 03-13-2012 10:00

Re: How to block some commands on a Specific map?
 
Quote:

IT's Possible?
Yes

bazhenov93 03-13-2012 10:27

Re: How to block some commands on a Specific map?
 
Quote:

Originally Posted by kiki33hun (Post 1667998)
Yes

but " HOW "

Xvil 03-14-2012 09:23

Re: How to block some commands on a Specific map?
 
This an Example to block The Buy Commands command:

PHP Code:

new const gBuyCommands[ ][ ] =
{
        
"usp""glock""deagle""p228""elites",
        
"fn57""m3""xm1014""mp5""tmp""p90",
        
"mac10""ump45""ak47""galil""famas",
        
"sg552""m4a1""aug""scout""awp""g3sg1",
        
"sg550""m249""vest""vesthelm""flash",
        
"hegren""sgren""defuser""nvgs""shield",
        
"primammo""secammo""km45""9x19mm""nighthawk",
        
"228compact""fiveseven""12gauge""autoshotgun",
        
"mp""c90""cv47""defender""clarion""krieg552",
        
"bullpup""magnum""d3au1""krieg550"
        
"buy""buyammo1""buyammo2""buyequip""cl_autobuy",
        
"cl_rebuy""cl_setautobuy""cl_setrebuy"
}
public 
plugin_init() 

    
register_plugin("Block Buy Example""0.1.0""Xvil"

    for (new 
isizeof gBuyCommandsi++) 
        
register_clcmd(gBuyCommands[i], "BlockBuyCommands"


public 
BlockBuyCommands(id
{
    
// Block the buy commands. 
    
return PLUGIN_HANDLED



killergirl 03-14-2012 10:43

Re: How to block some commands on a Specific map?
 
PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

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

// add maps here for restriction
new const rmaps[][] =
{
    
"kz_longjumps2",
    
"kzlt_weridjumps"
}

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[32]
    
    
get_mapname(mapcharsmax(map))
    
    for(new 
0sizeof(rmaps) - 1i++){
        if(
equal(rmaps[i], map)){
            
client_print(idprint_chat"This command it's blocked.")
            break
        }
    }
    
    return 
PLUGIN_HANDLED


From here you need to implement the code from your plugins.

lucas_7_94 03-14-2012 10:48

Re: How to block some commands on a Specific map?
 
I think its better to make the loop in the plugin_init , and if map is equal to the list , set any boolean in true , or register the clcmds.

Devil259 03-14-2012 11:17

Re: How to block some commands on a Specific map?
 
Quote:

Originally Posted by lucas_7_94 (Post 1668734)
I think its better to make the loop in the plugin_init , and if map is equal to the list , set any boolean in true , or register the clcmds.

Right, because here, even if it is not "kz_longjumps2" or "kzlt_weridjumps" map, commands are blocked by "return PLUGIN_HANDLED".

bazhenov93 03-14-2012 12:04

Re: How to block some commands on a Specific map?
 
Quote:

Originally Posted by killergirl (Post 1668730)
PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

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

// add maps here for restriction
new const rmaps[][] =
{
    
"kz_longjumps2",
    
"kzlt_weridjumps"
}

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[32]
    
    
get_mapname(mapcharsmax(map))
    
    for(new 
0sizeof(rmaps) - 1i++){
        if(
equal(rmaps[i], map)){
            
client_print(idprint_chat"This command it's blocked.")
            break
        }
    }
    
    return 
PLUGIN_HANDLED


From here you need to implement the code from your plugins.

does not work. i also DISABLED prokreedz and still not working

fysiks 03-14-2012 14:56

Re: How to block some commands on a Specific map?
 
Quote:

Originally Posted by bazhenov93 (Post 1667987)
On kz_longjumps2 // kzlt_weridjumps and longjumps maps, I want to block commans like " pro15 / top15 / nub15 " from kreedz plugin

BECAUSE i have my own PLUGIN, that when you type this commands, will show another records...

It sounds to me like you would be better off editing the kreedz plugin that has those commands and doing this:


Quote:

Originally Posted by lucas_7_94 (Post 1668734)
I think its better to make the loop in the plugin_init , and if map is equal to the list , set any boolean in true , or register the clcmds.


Xvil 03-14-2012 15:04

Re: How to block some commands on a Specific map?
 
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




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

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