steadyfi Posted March 21, 2015 Posted March 21, 2015 Hello Is there a way to check if a string is equal to a format, like HEX for exemple. I wan't to check if the player enters a VALID HEX CODE and if yes then go forward, else return. Is there a way to check if color == format("#%x%x%x%x%x%x") and check if HEX code is valid ? Thanks. My Work: OpenTeams | DayZ Admin Panel | vAuth Must-Have Library: MTA Lua Async ApocalipZ Owner coming back soon!
Et-win Posted March 21, 2015 Posted March 21, 2015 string.find(string, "#%x%x%x%x%x%x", 1, true) Correct me if I'm wrong. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
JR10 Posted March 21, 2015 Posted March 21, 2015 string.find(string, "#%x%x%x%x%x%x", 1) The last parameter shouldn't be true, this will treat the text as plain, which is not what he wants here. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
steadyfi Posted March 21, 2015 Author Posted March 21, 2015 string.find(string, "#%x%x%x%x%x%x", 1, true) Correct me if I'm wrong. Doesn't work string.find(string, "#%x%x%x%x%x%x", 1) The last parameter shouldn't be true, this will treat the text as plain, which is not what he wants here. It works, thanks ! My Work: OpenTeams | DayZ Admin Panel | vAuth Must-Have Library: MTA Lua Async ApocalipZ Owner coming back soon!
Et-win Posted March 21, 2015 Posted March 21, 2015 string.find(string, "#%x%x%x%x%x%x", 1) The last parameter shouldn't be true, this will treat the text as plain, which is not what he wants here. *cough* forgot *cough* ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now