Rudy Posted July 20, 2015 Share Posted July 20, 2015 (edited) Hey guys, What's the problem with this? if string.len(guiGetText(varible)) == 0 then --something end I think nothing, but it isn't works. I tested the guiGetText function with this varible, and it's works. Zero errors printed to my server's log. Thanks, Rudy Edited July 23, 2015 by Guest Link to comment
xXMADEXx Posted July 21, 2015 Share Posted July 21, 2015 What does debugscript (/debugscript 3) say? I don't see any problems, as long as 'variable' is assigned to a GUI element. Link to comment
Rudy Posted July 21, 2015 Author Share Posted July 21, 2015 I tested the guiGetText function with this varible, and it's works. Zero errors. It isn't that important, because this is only a comfort function - but it'd be good if somebody write down what is the problem. Lines before and after this code are work too. Link to comment
Dealman Posted July 21, 2015 Share Posted July 21, 2015 And you're sure the string is completely empty? Is the GUI element properly created? If that if statement fails to run it could mean that guiGetText returns false - or nil. But if that was the case, it should output it in the debug. Make sure you check the debug for any errors. Link to comment
Rudy Posted July 23, 2015 Author Share Posted July 23, 2015 Yes, If it's empty returns false. I tested it first. And I write down again: errors do NOT exist. But I reinstalled all MTA server files, and the problem's solved. Link to comment
Dealman Posted July 23, 2015 Share Posted July 23, 2015 Yes, If it's empty returns false. I tested it first. And I write down again: errors do NOT exist. But I reinstalled all MTA server files, and the problem's solved. If the string is empty it should return 0 as far as I'm aware, and not false. It would only return false if the GUI element does not exist or it received something other than a string. Link to comment
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