mint3d Posted July 27, 2013 Posted July 27, 2013 I need help with making a team script ok basically i want a script that when i start it it puts teams in tab for me
Vector Posted July 27, 2013 Posted July 27, 2013 You can use this function to get all the teams created. getElementsByType ("team", getRootElement ()); Then, iterate over the table and do whatever. You can also use the next function to get the team name. getTeamName(theTeam) for example, local teams = getElementsByType ("team", getRootElement ()); for _, theTeam in ipairs (teams) do local teamName = getTeamName (theTeam); -- do whatever, for example, create a new tab in a tabpanel. guiCreateTab (teamName, theTabPanel); end;
mint3d Posted July 27, 2013 Author Posted July 27, 2013 I tired this and it didn't work local teams = getElementsByType ("Admins", getRootElement ()); for _, theTeam in ipairs (teams) do local teamName = getTeamName (theTeam); -- do whatever, for example, create a new tab in a tabpanel. guiCreateTab (teamName, theTabPanel); end;
Vector Posted July 27, 2013 Posted July 27, 2013 you can´t do local teams = getElementsByType ("Admins", getRootElement ()); that will return an empty list. you need to do this.... local teams = getElementsByType ("team", getRootElement ()); with this you will get a list of teams. please, read the information about the function getElementsByType to know what parameters need. getElementsByType
Majhol Posted July 27, 2013 Posted July 27, 2013 if your talking about admin then I guess its ACL thingy , casue admins aren't considered as an team but an ACL group
TAPL Posted July 27, 2013 Posted July 27, 2013 What do you mean by tab? do you mean scoreboard? You want create team?? createTeam Or explain yourself in better way, i can't get a shit.
papam77 Posted July 27, 2013 Posted July 27, 2013 Serverside: function TEAM () theTeam2 = createTeam ( "HERE PUT YOUR TEAM NAME", 0, 0, 0 ) end addEventHandler("onResourceStart", resourceRoot, TEAM) function SETACL() if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("ANY ACL GROUP")) then outputChatBox ( " You are in ACL " ) end end addEventHandler("onPlayerLogin",getRootElement(),SETACL) addEventHandler("onPlayerSpawn",getRootElement(),SETACL) Don't forget to edit aclGetGroup
mint3d Posted July 27, 2013 Author Posted July 27, 2013 No i mean i want it so it just makes teams in scoreboard
Castillo Posted July 27, 2013 Posted July 27, 2013 Just create the team, the scoreboard will show them after.
mint3d Posted July 27, 2013 Author Posted July 27, 2013 but what acl group should i add them? Everyone Basically all i wanted was it so when i start the resource i will look at scoreboard and i can see the teams i want Like Admin Armed Forces Swat Police Criminal stuff like that
Castillo Posted July 27, 2013 Posted July 27, 2013 ACL for what? teams has nothing to do with ACL. -- Name, Color ( R, G, B ) local teams = { { "Admin", 255, 0, 0 }, { "Armed Forces", 0, 200, 0 } } addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, team in ipairs ( teams ) do createTeam ( unpack ( team ) ) end end ) With this simple script, you can add as much teams as you want.
mint3d Posted July 27, 2013 Author Posted July 27, 2013 Thanks your the best scripter i know you always help me out thanks man.
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