nut.faction
Faction System.
Handles player factions/teams including whitelists, models, and team management. Factions are just a wrapper over the normal team
library. Essentially, each faction associates a table with a team. So, extra information can be stored for teams (e.g. salary, descriptions, etc...).
See also Faction Development
Functions
nut.faction.loadFromDir (directory)
nut.faction.loadFromDir
Internal
This is used internally - although you're able to use it you probably shouldn't.
Loads faction definitions from a directory
Parameters:
string directory Path to scan for faction filesnut.faction.get (identifier)
nut.faction.get
Gets a faction by index or uniqueID
Parameters:
vararg identifier Faction index (int) or uniqueID (string)Returns:
table Faction definition tablenut.faction.getIndex (uniqueID)
nut.faction.getIndex
Gets a faction's numeric index by uniqueID
Parameters:
string uniqueID Faction uniqueIDReturns:
number Faction indexnut.faction.formatModelData ()
nut.faction.formatModelData
Internal
This is used internally - although you're able to use it you probably shouldn't.
Formats the bodygroup data into a uniform style.
This allows bodygroup data per model to be submitted in 3 ways:
- As a string
("0121200")
- As a table with the bodygroup ID as the key
{[1] = 2, [2] = 1, [3] = 2, [4] = 0}
- As a table with the bodygroup name as the key
{head = 2, shoulders = 1, knees = 2, toes = 0}