Jump to content

getPlayersInTeam help


VenomOG

Recommended Posts

local theTeam = "Thugs"
local players = getPlayersInTeam ( theTeam ) 
if (getElementData(players,"Clan" == 5)then
 outputChatBox("Thugs: There are already 5 of your members ",source)
    end
  end

This is what im trieing to do , if there are 5 of the same clan members in a team then put that message

Link to comment
local theTeam = "Thugs"
local players = getPlayersInTeam(getTeamFromName(theTeam)) -- this part will break with debug error, getPlayersInTeam expecting team got nil, if a team under that name does not exist
if (#players >= 5) then -- count (#) the values in the table
  outputChatBox("Thugs: There are already 5 of your members ",source)
end

 

Edited by Investor
Link to comment
4 minutes ago, Investor said:

local theTeam = "Thugs"
local players = getPlayersInTeam(getTeamFromName(theTeam)) -- added getTeamFromName
if (#players >= 5) then -- count (#) the values in the table
  outputChatBox("Thugs: There are already 5 of your members ",source)
end

 

How can i make if there are an ammount of members in a clan there aka
if there are 5 terrorists,  then outpu that message
format : getElementData(source,"Clan"

Link to comment

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...