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

Question about how conflicts between commands are handled


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hery83s
New Member
Join Date: May 2018
Old 05-01-2018 , 19:01   Question about how conflicts between commands are handled
Reply With Quote #1

I had always used sm_ban <name> <time> previously in order to ban someone from my server, however I recently created my own command so that when you type !ban in chat, it bans the person and does some other custom messages/logging afterwards

PHP Code:
public OnPluginStart()
{
RegConsoleCmd("ban"Command_CustomBan);
}

public 
Action Command_CustomBan(int clientint args)
{
//Stuff

I was just reading through this page and noticed that apparently !ban is also able to be used by default as an alias for sm_ban (apparently you can omit sm_ from several commands this way). I haven't noticed any problems and whenever I type !ban it executes my code and not sm_ban, so does Sourcemod recognize when you create a command for one it has built in and give yours priority?
hery83s is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 05-01-2018 , 19:49   Re: Question about how conflicts between commands are handled
Reply With Quote #2

No, but an exact match wins over a sm_-prefixed match.
__________________
asherkin 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 17:34.


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