Dice Posted March 18, 2013 Posted March 18, 2013 Hi. How are you? if not string.find(getPlayerName ( getLocalPlayer() ), "[ClanTag]", 1 ) Curious on how to make it more narrow, with this line if someone has the name [Cl it will work. How can i make it so you literally have to have your name as [ClanTag]
csiguusz Posted March 18, 2013 Posted March 18, 2013 Since '[' and ']' are 'magical characters', you have to do it so: string.find(getPlayerName ( getLocalPlayer() ), "%[ClanTag%]", 1 )
Renkon Posted March 18, 2013 Posted March 18, 2013 string.find(getPlayerName(localPlayer), "\[ClanTag\]")
csiguusz Posted March 18, 2013 Posted March 18, 2013 string.find(getPlayerName(localPlayer), "\[ClanTag\]") This was my second thougth, but I tried the first one too, and I think it worked...
Dice Posted March 18, 2013 Author Posted March 18, 2013 ok works thanks, but the problem I was orginally having is let's say a players clantag is RN6 the if someone has the name RN or something, they will be able to pass, I need it to have the whole thing RN6 not just RN or N6
Guest Guest4401 Posted March 20, 2013 Posted March 20, 2013 Just use the 4th argument plain of string.find to allow "magical" characters... http://www.lua.org/manual/5.1/manual.ht ... tring.find E.g: string.find('[TAG]nameless','[TAG]',1,true) --Result: 1 5
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