-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lua
37 lines (27 loc) · 891 Bytes
/
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
-- Global plugin object.
Plugin = nil
-- Initialize the plugin.
function Initialize(plugin)
-- Setup configuration file.
dofile(cPluginManager:GetPluginsPath() .. "/InfoReg.lua")
-- Configure plugin name and version.
plugin:SetName(PLUGIN)
plugin:SetVersion(VERSION)
-- Set plugin to global.
Plugin = plugin
-- Load the configuration.
accounts:load()
-- Hooks
cPluginManager:AddHook(cPluginManager.HOOK_PLAYER_JOINED, OnPlayerJoined)
cPluginManager:AddHook(cPluginManager.HOOK_PLAYER_DESTROYED, OnPlayerDestroyed)
-- Register in-game commands.
RegisterPluginInfoCommands()
LOG("Initialized " .. PLUGIN .. " v." .. VERSION)
f:log(f:amount(coin:global()) .. " total Coin in world.")
return true
end
-- When the plugin is closing down save data.
function OnDisable()
LOG("Closing " .. PLUGIN .. " v." .. VERSION)
accounts:save()
end