Module cityrp.team

Team / Job handing.

Module Overview

Shared Functions

cityrp.team.add(name, color, males, females, description, salary, limitmin, oneper, access, blacklist, canmake, radio) Add a new team.
cityrp.team.get(name) Get a team from a name or index.
cityrp.team.query(name, key[, default]) Query a variable from a team.
cityrp.team.getlimit(key) Get the current team limit.
cityrp.team.getPresident() Get players in the Presidential team group.
cityrp.team.getPresidentAdministration() Get players in the Presidential Administration team group.
cityrp.team.getGovernment() Get players in the Government team group.
cityrp.team.getLawenforcement() Get players in the Law Enforcement team group.
cityrp.team.getRescue() Get players in the Rescue (FD) team group.
cityrp.team.getRebels() Get players in the Rebel (anarchist) team group.
cityrp.team.getMafia() Get players in the Mafia team group.

Server Functions

cityrp.team.canChange(ply, teamName) Check if a player can change into a job.
cityrp.team.makeSilent(ply, name) Silently change a player's team (no respawns)
cityrp.team.make(ply, name) Make a player a member of a team.

Shared Functions

cityrp.team.add(name, color, males, females, description, salary, limitmin, oneper, access, blacklist, canmake, radio)
Add a new team. This is the main function which creates a team, including calling team.SetUp, along wtih all other data.

Parameters:

  • name string The name of the job.
  • color Color The team colour.
  • males tab Table of male job models.
  • females tab Table of female job models.
  • description string The job description.
  • salary number The default salary.
  • limitmin number The minimum number of slots.
  • oneper number The number of people on the server required to add an additional slot.
  • access string The access required to join the job.
  • blacklist ???
  • canmake tab The list of item categories that can be made in that job.
  • radio bool If the team has a radio.

Returns:

    number The new team index.
cityrp.team.get(name)
Get a team from a name or index.

Parameters:

  • name string The name or index of the team.

Returns:

    optional table The team table.
cityrp.team.query(name, key[, default])
Query a variable from a team.

Parameters:

  • name string THe name of the team to query.
  • key string The name of the variable to query.
  • default The Default value to return if no name or key is found. (optional)

Returns:

    The return value.
cityrp.team.getlimit(key)
Get the current team limit.

Parameters:

  • key string The name of the team to query.

Returns:

    int The team limit.
cityrp.team.getPresident()
Get players in the Presidential team group.

Returns:

    table List of players.
cityrp.team.getPresidentAdministration()
Get players in the Presidential Administration team group.

Returns:

    table List of players.
cityrp.team.getGovernment()
Get players in the Government team group.

Returns:

    table List of players.
cityrp.team.getLawenforcement()
Get players in the Law Enforcement team group.

Returns:

    table List of players.
cityrp.team.getRescue()
Get players in the Rescue (FD) team group.

Returns:

    table List of players.
cityrp.team.getRebels()
Get players in the Rebel (anarchist) team group.

Returns:

    table List of players.
cityrp.team.getMafia()
Get players in the Mafia team group.

Returns:

    table List of players.

Server Functions

cityrp.team.canChange(ply, teamName)
Check if a player can change into a job.

Parameters:

  • ply Player The player to change.
  • teamName The name or ID of the team they're attempting to change into.

Returns:

  1. boolean If the change is allowed.
  2. string or table If change disallowed, string reason. If allowed, then team data table.
cityrp.team.makeSilent(ply, name)
Silently change a player's team (no respawns)

Parameters:

  • ply Player The player attempting to change.
  • name The name or ID of the team the player wishes to change to.

Returns:

  1. boolean If the change was allowed.
  2. string Denial reason.

See also:

cityrp.team.make(ply, name)
Make a player a member of a team.

Parameters:

  • ply Player The player attempting to change.
  • name The name or ID of the team the player wishes to change to.

Returns:

  1. boolean If the change was allowed.
  2. string Denial reason.