Economy¶
This page documents hooks in the economy category.
CanPickupMoney(activator, moneyEntity)View Source
Purpose
Determines whether a player may pick up a money entity before the amount is credited.
Category
Economy
Realm
Server
Parameters
Player activator The player trying to pick up the money.
Entity moneyEntity The money entity being used.
Returns
boolean|nil Return false to block the pickup. Returning nil allows the default behavior to continue.
Example Usage
hook.Add("CanPickupMoney", "liaExampleCanPickupMoney", function(activator, moneyEntity)
if activator:InVehicle() then
return false
end
end)
GetMoneyModel(amount)View Source
Purpose
Allows modules to override the model used when a money entity is initialized.
Category
Economy
Realm
Server
Parameters
number amount The money amount stored on the entity at initialization time.
Returns
string|nil Return a model path to override the configured default money model. Returning nil allows the default behavior to continue.
Example Usage
hook.Add("GetMoneyModel", "liaExampleGetMoneyModel", function(amount)
if amount >= 1000 then
return "models/props_lab/box01a.mdl"
end
end)
OnPickupMoney(client, moneyEntity)View Source
Purpose
Runs after a player successfully picks up a money entity so server systems can notify or log the transaction.
Category
Economy
Realm
Server
Parameters
Player client The player who picked up the money.
Entity moneyEntity The money entity that was consumed.
Example Usage
hook.Add("OnPickupMoney", "liaExampleServerPickupMoney", function(client, moneyEntity)
print(client:Nick(), moneyEntity:getAmount())
end)
ShouldOverrideSalaryTimers()View Source
Purpose
Determines whether Lilia should skip creating its default salary interval timers.
Category
Economy
Realm
Server
Returns
boolean|nil Return true to prevent the default salary timers from being created. Returning nil or false allows the normal timer setup.
Example Usage
hook.Add("ShouldOverrideSalaryTimers", "liaExampleShouldOverrideSalaryTimers", function()
return false
end)