Raised This Month: $87 Target: $400
 21% 

How to block some commands on a Specific map?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 03-13-2012 , 09:23   How to block some commands on a Specific map?
Reply With Quote #1

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.

Last edited by bazhenov93; 03-28-2012 at 22:45.
bazhenov93 is offline
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 03-13-2012 , 10:00   Re: How to block some commands on a Specific map?
Reply With Quote #2

Quote:
IT's Possible?
Yes
__________________
kiki33hun is offline
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 03-13-2012 , 10:27   Re: How to block some commands on a Specific map?
Reply With Quote #3

Quote:
Originally Posted by kiki33hun View Post
Yes
but " HOW "
bazhenov93 is offline
Xvil
BANNED
Join Date: Feb 2012
Old 03-14-2012 , 09:23   Re: How to block some commands on a Specific map?
Reply With Quote #4

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

Xvil is offline
killergirl
Senior Member
Join Date: Jul 2010
Old 03-14-2012 , 10:43   Re: How to block some commands on a Specific map?
Reply With Quote #5

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.
killergirl is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 03-14-2012 , 10:48   Re: How to block some commands on a Specific map?
Reply With Quote #6

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.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 03-14-2012 , 11:17   Re: How to block some commands on a Specific map?
Reply With Quote #7

Quote:
Originally Posted by lucas_7_94 View Post
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".
__________________
You can do anything you set your mind to, man.

Devil259 is offline
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 03-14-2012 , 12:04   Re: How to block some commands on a Specific map?
Reply With Quote #8

Quote:
Originally Posted by killergirl View Post
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
bazhenov93 is offline
Old 03-14-2012, 14:37
Xvil
This message has been deleted by Xvil.
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-14-2012 , 14:56   Re: How to block some commands on a Specific map?
Reply With Quote #9

Quote:
Originally Posted by bazhenov93 View Post
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 View Post
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.
__________________
fysiks is offline
Xvil
BANNED
Join Date: Feb 2012
Old 03-14-2012 , 15:04   Re: How to block some commands on a Specific map?
Reply With Quote #10

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


Last edited by Xvil; 03-14-2012 at 15:04.
Xvil 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 21:06.


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