Raised This Month: $ Target: $400
 0% 

Command Blocker


Post New Thread Reply   
 
Thread Tools Display Modes
guilty80100
Member
Join Date: Jul 2009
Old 08-10-2009 , 19:03   Re: Command Blocker
Reply With Quote #51

can we have an unblockcommand too? i want to allow spectating during during the ready up and to block spectate during the match, does it is possible ?
guilty80100 is offline
guilty80100
Member
Join Date: Jul 2009
Old 08-11-2009 , 04:40   Re: Command Blocker
Reply With Quote #52

it's dont work aswell for thirdpersonshoulder, why ?
guilty80100 is offline
guilty80100
Member
Join Date: Jul 2009
Old 08-11-2009 , 06:56   Re: Command Blocker
Reply With Quote #53

add this to create an unblock command, i test it i work i just don't do the identation

public OnPluginStart()
{
CreateConVar("sm_commandblocker_version", PLUGIN_VERSION, "Command Blocker Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FC VAR_NOTIFY);

RegServerCmd("sm_blockcommand", Cmd_Block, "Adds the cheat flag to a command");
RegServerCmd("sm_unblockcommand", Cmd_Unblock, "Retire the cheat flag of a command");
RegServerCmd("sm_bancommand", Cmd_Ban, "Bans users that attempt to use this command");
}


public Action:Cmd_Unblock(args)
{
if (args < 1)
{
ReplyToCommand(0, "Usage: sm_unblockcommand <command>");
return Plugin_Handled;
}

decl String:command[100];
GetCmdArg(1, command, sizeof(command));

new flags = GetCommandFlags(command);
flags &= ~FCVAR_CHEAT;
SetCommandFlags(command, flags);

ReplyToCommand(0, "Command successfully unblocked");

return Plugin_Handled;
}
guilty80100 is offline
ShambleS
Senior Member
Join Date: Jul 2009
Old 08-11-2009 , 13:25   Re: Command Blocker
Reply With Quote #54

i dont want to unblock any thing..

i want to make it kick instead of ban when some 1 uses a banned comand

I tried editing it so it doses SM_kick not sm_ban..
and now it dosent stop the commands at all.

Code:
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 \"Attempting to use banned command: %s\"", GetClientUserId(client), command);
    return Plugin_Handled;
}
i have it like that now..

if you missed it all i changed was this from sm_ban to sm_kick, and removed a 0 after the #%i (i think that was ban time,)
Code:
    decl String:command[100];
    GetCmdArg(0, command, sizeof(command));
    ServerCommand("sm_kick #%i \"Attempting to use banned command: %s\"", GetClientUserId(client), command);
    return Plugin_Handled;
But im wodering about the actual origional source plugin...

it says..

Code:
public Action:Cmd_Ban(args)
{
    if (args < 1)
    {
        ReplyToCommand(0, "Usage: sm_blockcommand <command>");
shouldnt that be..
Code:
public Action:Cmd_Ban(args)
{
    if (args < 1)
    {
        ReplyToCommand(0, "Usage: sm_bancommand <command>");
Is thats why it bans people when i use sm_blockcommand?

Last edited by ShambleS; 08-11-2009 at 13:59.
ShambleS is offline
olj
Veteran Member
Join Date: Jun 2009
Old 08-12-2009 , 04:05   Re: Command Blocker
Reply With Quote #55

Reply to command is just a message function. That s only a mistake in message.

Change server command to
Code:
ServerCommand("sm_kick #%i", GetClientUserId(client));
I removed reason parameter, mb that was the problem.
__________________

Last edited by olj; 08-12-2009 at 04:09.
olj is offline
ShambleS
Senior Member
Join Date: Jul 2009
Old 08-12-2009 , 10:09   Re: Command Blocker
Reply With Quote #56

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;
}

Last edited by ShambleS; 08-12-2009 at 11:19.
ShambleS is offline
guilty80100
Member
Join Date: Jul 2009
Old 09-06-2009 , 09:00   Re: Command Blocker
Reply With Quote #57

this don't block client command like spec_allowroaming or cam_colision
can it be updated for that ?
guilty80100 is offline
Stryfe.pawt
Junior Member
Join Date: Mar 2009
Old 09-24-2009 , 19:13   Re: Command Blocker
Reply With Quote #58

Has anyone used this to block the round ending exploit in L4D? I'd like to do that but I don't know the actual command to block. If someone could PM it to me(we should keep it out of public as much as possible) that would be awesome
Stryfe.pawt is offline
oneshot23
Senior Member
Join Date: Feb 2009
Old 10-14-2009 , 05:54   Re: Command Blocker
Reply With Quote #59

So are you able to do this
sm_blockcommand "sm plugins"?
oneshot23 is offline
Kramerika
Senior Member
Join Date: Dec 2004
Location: PA, US of A
Old 10-22-2009 , 11:53   Re: Command Blocker
Reply With Quote #60

Can you block the client wait or alias commands with this plugin?
Kramerika 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:20.


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