-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.lua
More file actions
25 lines (20 loc) · 811 Bytes
/
main.lua
File metadata and controls
25 lines (20 loc) · 811 Bytes
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
function Initialize( Plugin )
PLUGIN = Plugin
Plugin:SetName( "KiwiLock" )
Plugin:SetVersion( 2 )
PluginManager = cRoot:Get():GetPluginManager()
PluginManager:AddHook(cPluginManager.HOOK_PLAYER_USING_BLOCK, OnPlayerUsingBlock);
PluginManager:AddHook(cPluginManager.HOOK_PLAYER_BREAKING_BLOCK, OnPlayerBreakingBlock);
PluginManager:AddHook(cPluginManager.HOOK_UPDATING_SIGN, OnUpdatingSign);
if LoadSettings(PLUGIN:GetLocalFolder() .. "/Config.ini") == true then
LOGWARN( "Error while loading settings" )
end
LOG("Initialized " .. PLUGIN:GetName() .. " v" .. PLUGIN:GetVersion())
return true
end
function OnDisable()
LOG( PLUGIN:GetName() .. " v" .. PLUGIN:GetVersion() .. " is shutting down..." )
end
switch = function(cases,arg)
return assert (loadstring ('return ' .. cases[arg]))()
end