View Single Post
Author Message
404UserNotFound
BANNED
Join Date: Dec 2011
Old 02-24-2018 , 17:30   Snippet: Setting RGB/RGBA values via a command
Reply With Quote #1

Just a little something I've been tinkering with and finally got working the way I want it to. It'll be used in an upcoming update to my old Lo-Fi Longwave Beacon Deluxe plugin but I realize this could be very useful for people wanting an easy way to allow players to choose their own RGB/RGBA values for things like FuncommandsX's colorizing (or in my case, my fully separate player/weapon/cosmetic/building colorizing commands).

I've left some comment notes in there regarding some stuff. Got suggestions for improvement of this code? Send 'em my way!

Regex pattern was obtained from https://www.regular-expressions.info/numericranges.html

Update: Added new version 2 of the commands. Main difference is version 1 uses GetCmdArgString and regex checks the entire string using a huge regex pattern. Version 2 uses individual GetCmdArg's and a significantly smaller regex pattern to check each arg individually.

Version 1 - Tested, Working 100%


Version 2 - Untested

Last edited by 404UserNotFound; 02-25-2018 at 02:07.
404UserNotFound is offline