AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   Command Source Tag (https://forums.alliedmods.net/showthread.php?t=317296)

xfusionlockx 07-06-2019 18:22

Command Source Tag
 
This is a little line of code that you can add when sending the usage of a command to the player. It checks whether the command was sent from console or chat, and adds the correct tag accordingly.

Code:

GetCmdReplySource() == SM_REPLY_TO_CONSOLE ? "sm_" : "!"
You would add it in here:
Code:

ReplyToCommand(iClient, "Usage: %scolor <color>", GetCmdReplySource() == SM_REPLY_TO_CONSOLE ? "sm_" : "!");
Makes it more aesthetically pleasing in my opinion.


All times are GMT -4. The time now is 08:36.

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