Raised This Month: $ Target: $400
 0% 

Block console commands


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Vechta
Veteran Member
Join Date: Jun 2010
Old 08-02-2010 , 10:29   Block console commands
Reply With Quote #1

How i can block the command
jointeam 2 and jointeam 5?
Vechta is offline
Raddish
BANNED
Join Date: Jul 2008
Location: Argentina
Old 08-02-2010 , 10:36   Re: Block console commands
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <cstrike>

public plugin_init()
{
    
register_plugin("Register Command""2.0""Alucard")
}

public 
client_command(id)
{
    static 
argv[16]
    
read_argv(0argvcharsmax(argv) )
    
    if(
equali(argv"jointeam") && !cs_get_user_team) return PLUGIN_HANDLED

Thanks to Alucard^

http://forums.alliedmods.net/showpos...&postcount=134

Possible bug fix

PHP Code:
#include <amxmodx>
#include <cstrike>

public plugin_init()
{
    
register_plugin("Register Command""2.0""Alucard")
}

public 
client_command(id)
{
    static 
argv[16]
    
read_argv(0argvcharsmax(argv) )
    
    if(
equali(argv"jointeam") && cs_get_user_team(id) != CS_TEAM_UNASSIGNED) return PLUGIN_HANDLED

    
return PLUGIN_CONTINUE


Last edited by Raddish; 08-02-2010 at 10:38.
Raddish is offline
Vechta
Veteran Member
Join Date: Jun 2010
Old 08-02-2010 , 12:21   Re: Block console commands
Reply With Quote #3

Thanks, possible to block only teamjoin 2 to teamjoin9 ?
Vechta is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-02-2010 , 12:38   Re: Block console commands
Reply With Quote #4

If you want to always block :

PHP Code:
#include <amxmodx>

#define VERSION "0.0.1"

public plugin_init()
{
    
register_plugin("block jointeam"VERSION"ConnorMcLeod")

    
register_clcmd("jointeam 2""BlockJoinTeam")
    
register_clcmd("jointeam 5""BlockJoinTeam")
}

public 
BlockJoinTeam()
{
    return 
PLUGIN_HANDLED


If you want to allow primo joiners :

PHP Code:
#include <amxmodx>
#include <cstrike>

#define VERSION "0.0.1"

public plugin_init()
{
    
register_plugin("block jointeam"VERSION"ConnorMcLeod")

    
register_clcmd("jointeam 2""BlockJoinTeam")
    
register_clcmd("jointeam 5""BlockJoinTeam")
}

public 
BlockJoinTeam(id)
{
    return !(
cs_get_user_team(id) == CS_TEAM_UNASSIGNED)



If you want to allow jointeam from all kind of spectators :

PHP Code:
#include <amxmodx>
#include <cstrike>

#define VERSION "0.0.1"

public plugin_init()
{
    
register_plugin("block jointeam"VERSION"ConnorMcLeod")

    
register_clcmd("jointeam 2""BlockJoinTeam")
    
register_clcmd("jointeam 5""BlockJoinTeam")
}

public 
BlockJoinTeam(id)
{
    new 
CsTeams:iTeam cs_get_user_team(id)
    return !(
iTeam == CS_TEAM_UNASSIGNED || iTeam == CS_TEAM_SPECTATOR)


Note that old style menus don't send jointeam command.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Vechta
Veteran Member
Join Date: Jun 2010
Old 08-02-2010 , 13:49   Re: Block console commands
Reply With Quote #5

Dont work :S
Vechta is offline
Raddish
BANNED
Join Date: Jul 2008
Location: Argentina
Old 08-02-2010 , 16:36   Re: Block console commands
Reply With Quote #6

Quote:
Originally Posted by Vechta View Post
Dont work :S
my code?
Raddish is offline
nikodz
Junior Member
Join Date: Jul 2009
Old 08-02-2010 , 17:33   Re: Block console commands
Reply With Quote #7

PHP Code:
#include <amxmodx>
#include <cstrike>



public plugin_init() {
    
    
register_clcmd("jointeam 2""blockjoin")
    
register_clcmd("jointeam 5""blockjoin")
    
}

public 
blockjoin(id)
{
    if(
cs_get_user_team(id)==CS_TEAM_SPECTATOR || cs_get_user_team(id)==CS_TEAM_UNASSIGNED){
        return 
PLUGIN_CONTINUE;
    }
    return 
PLUGIN_HANDLED;

like ConnorMcLeod post. but i think this is correct if his code didn't work

Last edited by nikodz; 08-02-2010 at 17:37.
nikodz is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-03-2010 , 05:36   Re: Block console commands
Reply With Quote #8

http://forums.alliedmods.net/showpos...81&postcount=2

You can also try to replace

engclient_cmd(id, "chooseteam")

with

engclient_cmd(id, "jointeam 1")
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 00:09.


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