dewu Posted April 25, 2015 Share Posted April 25, 2015 Hello. Is any way to set group/gang limit of lengths? function createGroupForPlayer (playersource,command,...) local teamName = table.concat({...}, " ") if not isGuestAccount(getPlayerAccount(playersource)) and getElementData(playersource,"gang") == "None" then if teamName then if not isGangExisting (teamName) then addGang (teamName,getAccountName(getPlayerAccount(playersource))) setAccountData(getPlayerAccount(playersource),"gangslots",30) outputChatBox ("#FFFFFFYou successfully created your group with the name of: "..teamName..".",playersource,27, 89, 224,true) else outputChatBox ("#FFFFFFThere is a group with this name already!",playersource,27, 89, 224,true) end else outputChatBox ("#FFFFFFSyntax is /creategroup !",playersource,27, 89, 224,true) end else outputChatBox ("#FFFFFFYou are in a group already!",playersource,27, 89, 224,true) end end addCommandHandler("creategroup",createGroupForPlayer) Link to comment
WhoAmI Posted April 25, 2015 Share Posted April 25, 2015 local limit = 5 if ( #teamName > limit ) then -- length is too big else -- its okay end 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