Jump to content

Teams


mint3d

Recommended Posts

Posted

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

Skype: Jordan_Nymph

Posted

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;  
  

there are two kinds of people: those who know C++ and those who don´t. .)

Posted

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; 
  

Skype: Jordan_Nymph

Posted

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 

there are two kinds of people: those who know C++ and those who don´t. .)

Posted

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.

CiTLh.png
Posted

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

Posted

Just create the team, the scoreboard will show them after.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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

Skype: Jordan_Nymph

Posted

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.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

You're welcome.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...