Library faction

Factions library for interfacing with the server's faction system.

Functions

getAlliedMembers() Gets all online alliance members of the SF instance owner's alliance.
getFaction( ply ) Gets the faction the given player belongs to.
getFactionDetails( faction ) Returns an information table about the given faction.
getFactions() Gets the list of all factions.
getOnlineMembers() Gets all online members of the SF instance owner's faction.
getOnlinePlayers( faction ) Gets all online players in a given faction.
isAlly( ply ) Determines if the given player is allied with the SF instance's owner.
isEnemy( ply ) Determines if the given player is an enemy of the SF instance's owner.


Functions

faction.getAlliedMembers()
Gets all online alliance members of the SF instance owner's alliance.

Environment:

Server

Return value:

    (table) An array of all player entities online for the chip owner's alliance.
faction.getFaction( ply )
Gets the faction the given player belongs to.

Environment:

Server

Parameters:

  • ply: The player to get the faction of.

Return value:

    (string) The name of the faction they belong to, or "" if they do not belong to one.
faction.getFactionDetails( faction )
Returns an information table about the given faction.

Environment:

Server

Parameters:

  • faction: Name of the faction.

Return value:

    (Faction) Table with fields: Name, Tag, TagColour, LeaderID, Public.
faction.getFactions()
Gets the list of all factions.

Environment:

Server

Return value:

    (table) An array of all faction names.
faction.getOnlineMembers()
Gets all online members of the SF instance owner's faction.

Environment:

Server

Return value:

    (table) An array of all player entities online for the chip owner's faction.
faction.getOnlinePlayers( faction )
Gets all online players in a given faction.

Environment:

Server

Parameters:

  • faction: Name of the faction.

Return value:

    (table) Table of all online players.
faction.isAlly( ply )
Determines if the given player is allied with the SF instance's owner.

Environment:

Server

Parameters:

  • ply: The player to check.

Return value:

    (boolean) True if an ally, false if not.
faction.isEnemy( ply )
Determines if the given player is an enemy of the SF instance's owner.

Environment:

Server

Parameters:

  • ply: The player to check.

Return value:

    (boolean) True if an enemy, false if not.

Valid XHTML 1.0!