Raised This Month: $ Target: $400
 0% 

Command Blocker


Post New Thread Reply   
 
Thread Tools Display Modes
Happy DODs player
AlliedModders Donor
Join Date: Sep 2009
Old 01-06-2010 , 13:38   Re: Command Blocker
Reply With Quote #71

On our server people can not Join Spectate at all.

Only when they type it in console Spectate.

And i just want 2 block that also.

So what must i write down than in my cfg?
Happy DODs player is offline
leonil7
BANNED
Join Date: May 2009
Location: GB
Old 01-09-2010 , 03:45   Re: Command Blocker
Reply With Quote #72

shambles how long is a person 'kicked' from the server?

Quote:
Originally Posted by ShambleS View Post
ok
Now if i do sm_bancommand it kicks them out for doing the command.

here is the source thing
Code:
#pragma semicolon 1

#include <sourcemod>

#define PLUGIN_VERSION "1.0"

public Plugin:myinfo =
{
    name = "Command Blocker",
    author = "pRED*",
    description = "Lets you block or ban commands",
    version = PLUGIN_VERSION,
    url = "http://forums.alliedmods.net"
};

public OnPluginStart()
{
    CreateConVar("sm_commandblocker_version", PLUGIN_VERSION, "Command Blocker Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    
    RegServerCmd("sm_blockcommand", Cmd_Block, "Adds the cheat flag to a command");
    RegServerCmd("sm_bancommand", Cmd_Ban, "Bans users that attempt to use this command");
}

public Action:Cmd_Block(args)
{
    if (args < 1)
    {
        ReplyToCommand(0, "Usage: sm_blockcommand <command>");
        return Plugin_Handled;
    }
    
    decl String:command[100];
    GetCmdArg(1, command, sizeof(command));
    
    new flags = GetCommandFlags(command);
    SetCommandFlags(command, flags|FCVAR_CHEAT);
    
    ReplyToCommand(0, "Command successfully blocked");
    
    return Plugin_Handled;
}

public Action:Cmd_Ban(args)
{
    if (args < 1)
    {
        ReplyToCommand(0, "Usage: sm_blockcommand <command>");
        return Plugin_Handled;
    }
    
    decl String:command[100];
    GetCmdArg(1, command, sizeof(command));
    
    RegConsoleCmd(command, Cmd_Banned);
    
    ReplyToCommand(0, "Command successfully banned");
    
    return Plugin_Handled;
}

public Action:Cmd_Banned(client, args)
{
    decl String:command[100];
    GetCmdArg(0, command, sizeof(command));
    ServerCommand("sm_kick #%i", GetClientUserId(client), command);
    return Plugin_Handled;
}
leonil7 is offline
Send a message via ICQ to leonil7 Send a message via AIM to leonil7 Send a message via Yahoo to leonil7 Send a message via Skype™ to leonil7
SeekerPD
BANNED
Join Date: Dec 2009
Old 01-14-2010 , 14:56   Re: Command Blocker
Reply With Quote #73

So it seems that the plugin blocks the commands for everyone, including the admin. How to let the admin continue using it?
SeekerPD is offline
chunXray
Member
Join Date: Jul 2009
Old 01-14-2010 , 23:29   Re: Command Blocker
Reply With Quote #74

i was trying to block people who say like "!buy", "!shop" and something should not existing in my server
but sm_blockcommand "say !buy" is fail
i can only block say
chunXray is offline
egor1908
Veteran Member
Join Date: Sep 2009
Old 01-15-2010 , 09:55   Re: Command Blocker
Reply With Quote #75

You can't block a command that contains a parameter. Better explanation in an example: you can't block sv_cheats 1 but keep sv_cheats 0 unblocked.
The same with "say" command.
egor1908 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 01-28-2010 , 14:18   Re: Command Blocker
Reply With Quote #76

Coul'd I post list "bad commands" in here what should ban?
I know this is public forum, everyone can read these and start "bomb" servers...
Or ask PM me ?
Bacardi is offline
hellanator3
Member
Join Date: Feb 2010
Old 02-10-2010 , 17:40   Re: Command Blocker
Reply With Quote #77

Could someone give me an example on the way you type it in the server.cfg

say my server .cfg is like this WHERE DO I PUT THE BLOCKED COMMANDS

/ General Settings Cvars
sv_downloadurl ""
net_maxfilesize 64
sv_airaccelerate "150"
sv_allowupload 0
sv_allowdownload 1
mp_friendlyfire 0
mp_footsteps 1
mp_autoteambalance 0
mp_autokick 0
mp_flashlight 1
mp_tkpunish 1
mp_forcecamera 0
sv_alltalk 1
sv_pausable 0
sv_cheats 0
sv_consistency 1
sv_maxspeed 320
mp_hostagepenalty 5
mp_allowspectators 1
mp_chattime 20
sv_timeout 60
sv_gravity 800.1
sv_voiceenable 1
sv_voicecodec vaudio_speex
sv_pure 0
sv_pure_kick_clients 1
sv_lan 0
sv_region 0

// Round Specific Cvars
mp_freezetime 0
mp_roundtime 5.0
mp_startmoney 16000
mp_c4timer 35
mp_fraglimit 0
mp_timelimit 5
mp_playerid 0
mp_spawnprotectiontime 5
mp_timelimit 30

// Bandwidth Rates/settings Cvar
sv_minrate 40000
sv_maxrate 60000
sv_maxupdaterate 100
sv_minupdaterate 100
sv_maxcmdrate 100
sv_mincmdrate 100
sv_unlag 1
sv_maxunlag .5
sv_client_predict 1
sv_client_interpolate 1
sv_client_cmdrate_difference 30

Last edited by hellanator3; 02-10-2010 at 17:48.
hellanator3 is offline
Hipster
SourceMod Donor
Join Date: Jun 2009
Location: Florida
Old 02-10-2010 , 18:02   Re: Command Blocker
Reply With Quote #78

Just throw them in anywhere. For example:

Quote:
// Bandwidth Rates/settings Cvar
sv_minrate 40000
sv_maxrate 60000
sv_maxupdaterate 100
sv_minupdaterate 100
sv_maxcmdrate 100
sv_mincmdrate 100
sv_unlag 1
sv_maxunlag .5
sv_client_predict 1
sv_client_interpolate 1
sv_client_cmdrate_difference 30

// Commands to block
sm_blockcommand blah
sm_blockcommand blarrhhhh
sm_blockcommand arrgg
Hipster is offline
lindo81
BANNED
Join Date: Feb 2010
Old 02-16-2010 , 11:01   Re: Command Blocker
Reply With Quote #79

i tried to block the command "place"

this is used fot HlstatsX,so when players type in chat "place" they show their rank.

I couldn't block it ... i tryed to block it with chat filter but even then if you type : "/place" it's still displays it ...

is there i way to stop this ? .... it's very difficult to block this "/" i tryed so many tymes ... maybe some of you can help ?
lindo81 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-16-2010 , 11:09   Re: Command Blocker
Reply With Quote #80

This will not block "say !sadas" triggers
Only some commands through console, not everything.
__________________
Do not Private Message @me
Bacardi 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 21:45.


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