Teams¶
This page documents hooks in the teams category.
CanCharBeTransfered(character, targetValue, previousValue)View Source
Purpose
Determines whether a character may be transferred to a different faction or class.
Category
Teams
Realm
Server
Parameters
Character character The character being transferred.
number|string targetValue The destination faction or class identifier.
number|string previousValue The character's current faction or class identifier.
Returns
boolean|nil Return false to block the transfer.
Example Usage
hook.Add("CanCharBeTransfered", "liaExampleCanCharBeTransfered", function(character, targetValue, previousValue)
return true
end)
CanInviteToClass(client, target)View Source
Purpose
Determines whether a player may invite another player to a class.
Category
Teams
Realm
Server
Parameters
Returns
boolean|nil Return false to block the class invitation.
Example Usage
hook.Add("CanInviteToClass", "liaExampleCanInviteToClass", function(client, target)
if IsValid(client) and client:IsAdmin() then
return true
end
end)
CanInviteToFaction(client, target)View Source
Purpose
Determines whether a player may invite another player to a faction.
Category
Teams
Realm
Server
Parameters
Returns
boolean|nil Return false to block the faction invitation.
Example Usage
hook.Add("CanInviteToFaction", "liaExampleCanInviteToFaction", function(client, target)
if IsValid(client) and client:IsAdmin() then
return true
end
end)
CanPlayerJoinClass(client, class, info)View Source
Purpose
Determines whether a player may join a class during class eligibility checks.
Category
Teams
Realm
Server
Parameters
Player client The player attempting to join the class.
number class The class index being checked.
table info The registered class data for the class.
Returns
boolean|nil Return false to block the class join attempt.
Example Usage
hook.Add("CanPlayerJoinClass", "liaExampleCanPlayerJoinClass", function(client, class, info)
if IsValid(client) and client:IsAdmin() then
return true
end
end)
CheckFactionLimitReached(faction, character, client)View Source
Purpose
Allows code to override faction population limit checks.
Category
Teams
Realm
Server
Parameters
number|string faction The faction being checked.
Character character The character being evaluated for the faction.
Player client The player associated with the character.
Returns
boolean|nil Return true when the faction should be treated as full.
Example Usage
hook.Add("CheckFactionLimitReached", "liaExampleCheckFactionLimitReached", function(faction, character, client)
if IsValid(client) and client:IsAdmin() then
return true
end
end)
OnPlayerJoinClass(client, class, oldClass)View Source
Purpose
Runs after a player is assigned to a class so modules can react to the new class and any transferred state.
Category
Teams
Realm
Server
Parameters
Player client The player joining the class.
number class The class index the player has just joined.
number oldClass optional The previous class index when the player switched from another class.
Example Usage
hook.Add("OnPlayerJoinClass", "liaExampleOnPlayerJoinClass", function(client, class, oldClass)
if IsValid(client) then
print(client:Nick(), "joined class", class, "from", oldClass)
end
end)
OverrideFactionDesc(uniqueID, desc)View Source
Purpose
Allows clientside code to override a faction description before display.
Category
Teams
Realm
Client
Parameters
string uniqueID The faction unique ID or display identifier.
string desc The current faction description text.
Returns
string|nil Return replacement description text.
Example Usage
hook.Add("OverrideFactionDesc", "liaExampleOverrideFactionDesc", function(uniqueID, desc)
return "MyModule Override"
end)
OverrideFactionModelCustomization(client, faction, context, skinAllowed, bodygroupsAllowed)View Source
Purpose
Allows clientside code to override whether faction model skins or bodygroups may be customized.
Category
Teams
Realm
Client
Parameters
Player client The player viewing or creating the character.
table faction The faction data being customized.
any context The customization context provided by the caller.
boolean skinAllowed The current skin customization permission.
boolean bodygroupsAllowed The current bodygroup customization permission.
Returns
boolean|nil, boolean|nil Return replacement values for skin and bodygroup customization permissions.
Example Usage
hook.Add("OverrideFactionModelCustomization", "liaExampleOverrideFactionModelCustomization", function(client, faction, context, skinAllowed, bodygroupsAllowed)
if faction and faction.uniqueID == "staff" then
return false, true
end
end)
OverrideFactionModels(uniqueID, models)View Source
Purpose
Allows clientside code to override the model list used for a faction.
Category
Teams
Realm
Client
Parameters
string uniqueID The faction unique ID or display identifier.
table models The current faction model list.
Returns
table|nil Return a replacement model list.
Example Usage
hook.Add("OverrideFactionModels", "liaExampleOverrideFactionModels", function(uniqueID, models)
return {
{name = "Example", value = 1}
}
end)
OverrideFactionName(uniqueID, name)View Source
Purpose
Allows clientside code to override a faction name before display.
Category
Teams
Realm
Client
Parameters
Returns
string|nil Return replacement faction name text.
Example Usage
hook.Add("OverrideFactionName", "liaExampleOverrideFactionName", function(uniqueID, name)
return "MyModule Override"
end)
PopulateFactionRosterOptions(list, members)View Source
Purpose
Allows clientside code to add extra options to the faction roster UI.
Category
Teams
Realm
Client
Parameters
Example Usage
hook.Add("PopulateFactionRosterOptions", "liaExamplePopulateFactionRosterOptions", function(list, members)
if not IsValid(list) then return end
list:SetTooltip("PopulateFactionRosterOptions handled by MyModule")
end)