Raised This Month: $51 Target: $400
 12% 

[L4D2] Set a flag for a command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Marchello
Senior Member
Join Date: Jan 2010
Old 05-05-2010 , 07:59   [L4D2] Set a flag for a command
Reply With Quote #1

I want to set the flag "a" for "ping" command. So only admins could use it.
And do I understand correctly that if a client without this flag will type "ping" in console he will just get nothing?
Marchello is offline
Scone
Senior Member
Join Date: Apr 2010
Location: England
Old 05-05-2010 , 11:44   Re: [L4D2] Set a flag for a command
Reply With Quote #2

You can override command access using the SourceMod admin configuration:

http://wiki.alliedmods.net/Overridin...28SourceMod%29

If you've written the plugin yourself, just pass the desired flag into RegAdminCmd.
__________________
Scone is offline
Marchello
Senior Member
Join Date: Jan 2010
Old 05-05-2010 , 17:40   Re: [L4D2] Set a flag for a command
Reply With Quote #3

So I need to write in "admin_overrides.cfg":
"ping" "abc"

?
Quote:
If you've written the plugin yourself, just pass the desired flag into RegAdminCmd.
The problem is I don't even know how to begin..
Marchello is offline
rcarm
Member
Join Date: Feb 2010
Old 05-05-2010 , 17:56   Re: [L4D2] Set a flag for a command
Reply With Quote #4

AFAIK, "ping" is a client command like "status", it can't be blocked by the server.

As for blocking other commands,

PHP Code:
    RegAdminCmd("command_here"Command_SomethingADMFLAG_CHAT); // Change ADMFLAG_CHAT to whatever flag you want. 
should work.

Last edited by rcarm; 05-07-2010 at 21:27.
rcarm is offline
Marchello
Senior Member
Join Date: Jan 2010
Old 05-05-2010 , 18:22   Re: [L4D2] Set a flag for a command
Reply With Quote #5

do I need like #include and such stuff?

I mean I need only to copypaste it and compile? I have doubts..
Marchello is offline
Marchello
Senior Member
Join Date: Jan 2010
Old 05-07-2010 , 10:45   Re: [L4D2] Set a flag for a command
Reply With Quote #6

Code:
#include <sourcemod>

#define PLUGIN_VERSION "1.0"

public Plugin:myinfo =
{
	name = "Command Blocker",
	author = "someone",
	description = "blocking ping",
	version = PLUGIN_VERSION,
	url = "http://forums.alliedmods.net"
};
public OnPluginStart()
{
RegAdminCmd("ping", a);
return Plugin_Handled;
}
is that correct?

Also, can it set a flag for "chooseteam" too?
Marchello is offline
dirka_dirka
Veteran Member
Join Date: Nov 2009
Old 05-07-2010 , 14:48   Re: [L4D2] Set a flag for a command
Reply With Quote #7

a is not a flag - at least not in that format. it is only a letter.

as posted above ADMINFLAG_CHAT, or any of the following:

ADMFLAG_RESERVATION
ADMFLAG_GENERIC
ADMFLAG_KICK
ADMFLAG_BAN
ADMFLAG_UNBAN
ADMFLAG_SLAY
ADMFLAG_CHANGEMAP
ADMFLAG_CONVARS
ADMFLAG_CONFIG
ADMFLAG_CHAT
ADMFLAG_VOTE
ADMFLAG_PASSWORD
ADMFLAG_RCON
ADMFLAG_CHEATS
ADMFLAG_ROOT
ADMFLAG_CUSTOM1
ADMFLAG_CUSTOM2
ADMFLAG_CUSTOM3
ADMFLAG_CUSTOM4
ADMFLAG_CUSTOM5
ADMFLAG_CUSTOM6
dirka_dirka is offline
Marchello
Senior Member
Join Date: Jan 2010
Old 05-08-2010 , 03:46   Re: [L4D2] Set a flag for a command
Reply With Quote #8

Oh well.
Redid:
Code:
#include <sourcemod>

#define PLUGIN_VERSION "1.0"

public Plugin:myinfo =
{
	name = "Command Flagger",
	author = "someone",
	description = "flaging ping",
	version = PLUGIN_VERSION,
	url = "http://forums.alliedmods.net"
};

public OnPluginStart()
{
	RegAdminCmd("ping", Command_Ping, ADMFLAG_KICK);
}
 
public Action:Command_Ping(client, args)
{
return Plugin_Handled;
}
Didn't work out!
It blocked the command, but the command lost its functionality (I have kick flag, I'm a root)
So I guess it's impossible to set a flag for this command then?

Last edited by Marchello; 05-08-2010 at 06:30.
Marchello is offline
Marchello
Senior Member
Join Date: Jan 2010
Old 05-09-2010 , 03:50   Re: [L4D2] Set a flag for a command
Reply With Quote #9

Impossible??? Can't be!
Marchello is offline
rcarm
Member
Join Date: Feb 2010
Old 05-09-2010 , 03:57   Re: [L4D2] Set a flag for a command
Reply With Quote #10

Return Plugin_Continue instead of Plugin_Handled
rcarm 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 03:57.


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