Salary¶
This page documents hooks in the salary category.
CanPlayerEarnSalary(client)View Source
Purpose
Determines whether a player should receive salary checks when the salary timers fire.
Category
Salary
Realm
Server
Parameters
Player client The player being considered for salary payment.
Returns
boolean|nil Return false to skip salary payment for the player. Returning nil allows the default behavior to continue.
Example Usage
hook.Add("CanPlayerEarnSalary", "liaExampleCanPlayerEarnSalary", function(client)
if client:getNetVar("jailed") then
return false
end
end)
GetPrestigePayBonus(client, char, pay, charFaction, class)View Source
Purpose
Allows plugins or modules to add an extra prestige-style bonus on top of the current salary amount.
Category
Salary
Realm
Server
Parameters
Player client The player receiving salary.
Character char The player's current character.
number pay The current salary value before the prestige bonus is added.
table charFaction The faction data for the player's character.
table class optional The class data for the player's character, if any.
Returns
number|nil Return a numeric bonus to add to the current pay. Returning nil allows the default behavior to continue.
Example Usage
hook.Add("GetPrestigePayBonus", "liaExampleGetPrestigePayBonus", function(client, char, pay, charFaction, class)
if char:getData("prestige", 0) > 0 then
return 50
end
end)
GetSalaryAmount(client, charFaction, class)View Source
Purpose
Allows plugins or modules to override the base salary amount before bonuses and final adjustments are applied.
Category
Salary
Realm
Server
Parameters
Player client The player receiving salary.
table charFaction The faction data for the player's character.
table class optional The class data for the player's character, if any.
Returns
number|nil Return a numeric salary amount to override the base pay. Returning nil allows the default behavior to continue.
Example Usage
hook.Add("GetSalaryAmount", "liaExampleGetSalaryAmount", function(client, charFaction, class)
if class and class.uniqueID == "chief" then
return 250
end
end)
OnSalaryAdjust(client)View Source
Purpose
Allows plugins or modules to replace the current salary amount before prestige bonuses are applied.
Category
Salary
Realm
Server
Parameters
Player client The player receiving salary.
Returns
number|nil Return a numeric salary amount to replace the current pay value. Returning nil allows the default behavior to continue.
Example Usage
hook.Add("OnSalaryAdjust", "liaExampleOnSalaryAdjust", function(client)
if client:hasPrivilege("salaryBonus") then
return 300
end
end)
OnSalaryGiven(client, char, pay, charFaction, class)View Source
Purpose
Allows plugins or modules to override the final salary amount immediately before money is awarded.
Category
Salary
Realm
Server
Parameters
Player client The player receiving salary.
Character char The player's current character.
number pay The current salary amount.
table charFaction The faction data for the player's character.
table class optional The class data for the player's character, if any.
Returns
number|nil Return a numeric value to replace the final salary payout. Returning nil allows the default behavior to continue.
Example Usage
hook.Add("OnSalaryGiven", "liaExampleOnSalaryGiven", function(client, char, pay, charFaction, class)
return math.max(pay, 25)
end)
PreSalaryGive(client, char, pay, charFaction, class)View Source
Purpose
Runs before the framework gives salary money to the character.
Category
Salary
Realm
Server
Parameters
Player client The player receiving salary.
Character char The player's current character.
number pay The current salary amount.
table charFaction The faction data for the player's character.
table class optional The class data for the player's character, if any.
Returns
boolean|nil Return true to mark salary handling as fully handled and suppress the default payout. Returning nil allows the default behavior to continue.
Example Usage
hook.Add("PreSalaryGive", "liaExamplePreSalaryGive", function(client, char, pay, charFaction, class)
if pay <= 0 then
return true
end
end)