Events
Client-side
core:setMoney
This is a low-level event used to visually set the money display.
client/main.lua
TriggerEvent("core:setMoney", amount --[[int]]);
-- amount: money amount
core:addedMoney
This is a low-level event used to visually add money to the money display.
client/main.lua
TriggerEvent("core:addedMoney", amount --[[int]]);
-- amount: money added
core:removedMoney
This is a low-level event used to visually remove money from the money display.
client/main.lua
TriggerEvent("core:removedMoney", amount --[[int]]);
-- amount: money removed
core:displayMoney
This is a low-level event used to temporarily show the money display.
client/main.lua
TriggerEvent("core:displayMoney", show --[[bool]], amount --[[int]]);
-- show: whether the display should be shown
-- amount?: money amount
core:getClosestPlayer
This event will find the closest player.
client/main.lua
TriggerEvent("core:getClosestPlayer", range --[[int]], cb --[[function]]);
-- range: the distance to check around
-- cb: callback function with found player data
For example:
client/main.lua
TriggerEvent("core:getClosestPlayer", 5.0, function(player)
print(player.id);
print(player.name);
print(player.dist);
end)
Server-side
core:first_join
This event is triggered when the network session has started for a client.
server/main.lua
AddEventHandler("core:first_join", function()
-- source
end);
core:playerLoaded
This event is triggered when the user object is initialised for a player.
server/main.lua
AddEventHandler("core:playerLoaded", function(src, user)
print("Player Id "..src.." has loaded as user Id "..user.get("id"));
end);