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

Removing a RegConsoleCmd() command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pilger
Senior Member
Join Date: Sep 2010
Old 04-28-2013 , 22:15   Removing a RegConsoleCmd() command
Reply With Quote #1

Is there a way to do this!?

I want to override a team change only on certain occasions and I figured the simplest way to do it was to create and then destroy the command when it was disabled.


Thanks in advance!
pilger is offline
minimoney1
SourceMod Donor
Join Date: Dec 2010
Old 04-28-2013 , 22:58   Re: Removing a RegConsoleCmd() command
Reply With Quote #2

You could return Plugin_Handled; in the command callback (but one drawback to this is that if you try to run the command from chat (e.g. running sm_ban as !ban), it tries to run the command and prints "Unknown Command" in console).
I would support a native such as UnregConsoleCmd() or something of that sort, but I could also imagine reasons why it wouldn't be implemented as well.
You could also use AddCommandListener and RemoveCommandListener if you're trying to hook the teamchange command.
__________________
Need help? PM me or add me on Steam.
My Steam




Quote:
Originally Posted by Rp.KryptoNite View Post
For some reason his Plugin never worked for me ,
@credits were added
im not stealing any plugins dude its my THING
minimoney1 is offline
pilger
Senior Member
Join Date: Sep 2010
Old 04-28-2013 , 23:08   Re: Removing a RegConsoleCmd() command
Reply With Quote #3

I managed to use the CommandListener functions with success indeed, but I could imagine many ocassions when it wouldn't be functional.

Something to unregister the commands would be most welcome.
pilger 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 06:27.


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