Baseplate Posted September 9, 2011 Share Posted September 9, 2011 well I have took Puma autoteams and I did some changes is this right? ---------Made by |DGT|Puma-------------- ---------------do not change or touch this---------- Names={} Tags={} Colors={} -------------------------------------------------------------- ---------------------------here put your clans read readme for instructions--------------------------------------- local names ={"FWC Admin"} local tags ={"%FWC%"} local colors ={#fffafa} -------- load------------ function loadTeams() for i,name in pairs(names) do Names[i]=name end for i,tag in pairs(tags) do Tags[i]=tag end for i,color in pairs(colors) do Colors[i] = color end end addEventHandler("onResourceStart",root,loadTeams) --------------------------------------------------- ----- move on start------------------ function moveOnStart() for i,player in pairs(getElementsByType("player")) do check(player) end end addEventHandler("onResourceStart",root,moveOnStart) ------------------------------------------------------------------------- -----------check---------------------------- function check (player) end local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" ) ) then setPlayerTeam(player,nil) for i,tag in pairs(tags) do if string.find(getPlayerName(player),tag) then local name = Names[i] local color = Colors[i] if not getTeamFromName(name) then createTeam(name,getColorFromString(color)) end local team = getTeamFromName(name) setPlayerTeam(player,team) end end -------------------------------- ----------remove Empty Team ---------- function remove() for t,teams in pairs(names) do local team = getTeamFromName(teams) if team then if countPlayersInTeam ( team )==0 then destroyElement(team) end end end end ----------------------------------------------------- -------NickChange------------- function nick(old,new) setTimer(check,1000,1,source) setTimer(remove,1500,1) end addEventHandler("onPlayerChangeNick",root,nick) --------------------------------------------- -------Join-------------------------------- function join() setTimer(check,4000,1,source) end addEventHandler("onPlayerJoin",root,join) ------------------------------- ---------Quit--------------------- function quit(player) setTimer(remove,1000,1) end addEventHandler("onPlayerQuit",root,quit) ------------------------------------ Link to comment
Baseplate Posted September 9, 2011 Author Share Posted September 9, 2011 I did but didn't work Link to comment
JR10 Posted September 9, 2011 Share Posted September 9, 2011 ---------Made by |DGT|Puma-------------- ---------------do not change or touch this---------- Names={} Tags={} Colors={} -------------------------------------------------------------- ---------------------------here put your clans read readme for instructions--------------------------------------- local names ={"FWC Admin"} local tags ={"%FWC%"} local colors ={#fffafa} -------- load------------ function loadTeams() for i,name in pairs(names) do Names[i]=name end for i,tag in pairs(tags) do Tags[i]=tag end for i,color in pairs(colors) do Colors[i] = color end end addEventHandler("onResourceStart",root,loadTeams) --------------------------------------------------- ----- move on start------------------ function moveOnStart() for i,player in pairs(getElementsByType("player")) do check(player) end end addEventHandler("onResourceStart",root,moveOnStart) ------------------------------------------------------------------------- -----------check---------------------------- function check (player) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" ) ) then setPlayerTeam(player,nil) for i,tag in pairs(tags) do if string.find(getPlayerName(player),tag) then local name = Names[i] local color = Colors[i] end if not getTeamFromName(name) then createTeam(name,getColorFromString(color)) end local team = getTeamFromName(name) setPlayerTeam(player,team) end end end -------------------------------- ----------remove Empty Team ---------- function remove() for t,teams in pairs(names) do local team = getTeamFromName(teams) if team then if countPlayersInTeam ( team )==0 then destroyElement(team) end end end end ----------------------------------------------------- -------NickChange------------- function nick(old,new) setTimer(check,1000,1,source) setTimer(remove,1500,1) end addEventHandler("onPlayerChangeNick",root,nick) --------------------------------------------- -------Join-------------------------------- function join() setTimer(check,4000,1,source) end addEventHandler("onPlayerJoin",root,join) ------------------------------- ---------Quit--------------------- function quit() setTimer(remove,1000,1) end addEventHandler("onPlayerQuit",root,quit) ------------------------------------ Link to comment
Cadu12 Posted September 9, 2011 Share Posted September 9, 2011 viewtopic.php?f=108&t=35477 Btw what are you using TAG? |FWC|, %FWC%, !FWC!, or etc? Link to comment
bandi94 Posted September 9, 2011 Share Posted September 9, 2011 (edited) this is not right local names ={"FWC Admin"} local tags ={"%FWC%"} local colors ={#fffafa} here test it whit this local names ={"FWC Admin"} local tags ={"%FW%C"} --- % need to be first and last by one local colors ={"#fffafa"} -- color code need to be in "" BT (i am Puma ) you try to check ACl right's for a team if i am right Try this not tested but sould work ---------Made by |DGT|Puma-------------- ---------------do not change or touch this---------- Names={} Tags={} Colors={} ACL={} -------------------------------------------------------------- ---------------------------here put your clans read readme for instructions--------------------------------------- local names ={"FWC Admin"} local tags ={"%FWC%>"} local colors ={"#fffafa"} local acls={"Admin"} --- put the acl name if you wanna check ACL group or "none" if you don't wanna check -------- load------------ function loadTeams() for i,name in pairs(names) do Names[i]=name end for i,tag in pairs(tags) do Tags[i]=tag end for i,color in pairs(colors) do Colors[i] = color end for i,acl in pairs(acls) do ACL[i] = acl end end addEventHandler("onResourceStart",root,loadTeams) --------------------------------------------------- ----- move on start------------------ function moveOnStart() for i,player in pairs(getElementsByType("player")) do check(player) end end addEventHandler("onResourceStart",root,moveOnStart) ------------------------------------------------------------------------- -----------check---------------------------- function check (player) setPlayerTeam(player,nil) for i,tag in pairs(tags) do if string.find(getPlayerName(player),tag) then local account=getPlayerAccount(player) if ACL[i]~="none" and not isObjectInACLGroup ( "user." ..getAccountName(account) , aclGetGroup ( ACL[i] ) ) then return end local name = Names[i] local color = Colors[i] if not getTeamFromName(name) then createTeam(name,getColorFromString(color)) end local team = getTeamFromName(name) setPlayerTeam(player,team) end end end -------------------------------- ----------remove Empty Team ---------- function remove() for t,teams in pairs(names) do local team = getTeamFromName(teams) if team then if countPlayersInTeam ( team )==0 then destroyElement(team) end end end end ----------------------------------------------------- -------NickChange------------- function nick(old,new) setTimer(check,1000,1,source) setTimer(remove,1500,1) end addEventHandler("onPlayerChangeNick",root,nick) --------------------------------------------- -------Join-------------------------------- function join() setTimer(check,4000,1,source) end addEventHandler("onPlayerJoin",root,join) ------------------------------- ---------Quit--------------------- function quit(player) setTimer(remove,1000,1) end addEventHandler("onPlayerQuit",root,quit) ------------------------------------ Edited September 9, 2011 by Guest Link to comment
Baseplate Posted September 9, 2011 Author Share Posted September 9, 2011 I'm using FWC> Tag Link to comment
bandi94 Posted September 9, 2011 Share Posted September 9, 2011 test whit that code copy past again bk i forgot the getAcountName Link to comment
Baseplate Posted September 9, 2011 Author Share Posted September 9, 2011 Ok thanks to all who helped me Link to comment
Baseplate Posted September 9, 2011 Author Share Posted September 9, 2011 no tag_admin:server.lua:35:''expected 'end' Link to comment
bandi94 Posted September 9, 2011 Share Posted September 9, 2011 try now sorry i forgot to delete the old function end Link to comment
Baseplate Posted September 9, 2011 Author Share Posted September 9, 2011 Ok I'll try it EDIT:WORKS NOW! THNXS 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