Tockra Posted July 7, 2010 Posted July 7, 2010 Hello guys, i want, that a player with a special clan tag can't connect (ABC). Because this i made a script : http://pastebin.com/Vsn6s6SW There isnt a problem, but i want that a guy, who connects with the Clan tag "abc" cant connect,too because that i made this: http://pastebin.com/AxzgLiJh But that want not run ! Need help...
Lordy Posted July 7, 2010 Posted July 7, 2010 When you use [] in string functions, it defines a new set http://lua-users.org/wiki/PatternsTutorial look for sets. So when using string.find(stringa,"[abc]") it returns if either a, b or c is found. In order to fix it, you need to escape [ and ]. I think they can be escaped with %[ and %] but I'm not sure.
50p Posted July 7, 2010 Posted July 7, 2010 string.find looks for patterns. If you don't want it, just turn it off (4th parameter). string.find (s, pattern [, init [, plain]])...A value of true as a fourth, optional argument plain turns off the pattern matching facilities, so the function does a plain "find substring" operation, with no characters in pattern being considered "magic". Note that if plain is given, then init must be given as well.
50p Posted July 7, 2010 Posted July 7, 2010 Yes. And why don't you try it before you ask? Always try before you ask.
Tockra Posted July 7, 2010 Author Posted July 7, 2010 Because that dont run ... false is advanced setting... Other question, cant i use getPlayerNametagText for that? €: That run : ..or string.find(playerN,"[abc]",1,true but i dont know why
50p Posted July 7, 2010 Posted July 7, 2010 Yes, you can, but you should use getPlayerName instead. string.find( getPlayerName( player ), "[abc]", 1, true );
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