Woovie Posted February 17, 2008 Posted February 17, 2008 I am trying to make a temporary nick system, similiar to Halo 3's tags. I want it to be forced to be 1 letter, a-z, and 2 numbers, 0-9. How can I limit this ? Here is my code so far. function joinRed ( player, commandName, shortName ) local nickCurrent = getClientName ( player ) local nickNew = shortName local nickSet = getElementData( thePlayer, "origNick" ) if ( nickSet == false ) then setElementData ( player, "origNick", nickCurrent ) end setClientName ( player, nickNew ) end "The humble beet is the answer to all riddles." - Rolf
Ace_Gambit Posted February 21, 2008 Posted February 21, 2008 I think what you are looking for is something called regular expressions or pattern matching. Lua has a few functions for pattern matching but I never tried them myself. You'll have to experiment with string.find, string.gfind and string.gsub. Development blog Kings of San Andreas
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