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

Snippet: Setting RGB/RGBA values via a command


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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 09:28.


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