Fist Posted November 20, 2014 Share Posted November 20, 2014 Hello everyone. Someone can explain me how i can make player can add other players to that team what he is now in, with command like this /addplayer Link to comment
Blinker. Posted November 20, 2014 Share Posted November 20, 2014 function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end function addPlayer (thePlayer,cmd,target) local target = getPlayerFromPartialName(target) if target then setPlayerTeam(target,getPlayerTeam(thePlayer)) end end addCommandHandler("addplayer",addPlayer) Link to comment
Fist Posted November 20, 2014 Author Share Posted November 20, 2014 thanks, hope it works i cant test it now. 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