-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathinit.lua
More file actions
56 lines (34 loc) · 955 Bytes
/
init.lua
File metadata and controls
56 lines (34 loc) · 955 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
function Initialize(a_Plugin)
a_Plugin:SetName("Login")
a_Plugin:SetVersion(g_PluginInfo.Version)
-- Load the InfoReg shared library:
dofile(cPluginManager:GetPluginsPath() .. "/InfoReg.lua")
-- Bind all the commands:
RegisterPluginInfoCommands();
-- Load and initialize the config.
InitConfig()
-- Load the password storage according to the config file
InitStorage()
-- Load the hooks
InitHooks()
cRoot:Get():ForEachPlayer(
function(a_Player)
-- Log all the users that are currently online in
GetPlayerState(a_Player, true)
end
)
LOG("Login is initialized")
return true
end
function OnDisable()
cRoot:Get():ForEachPlayer(
function(a_Player)
local PlayerState = GetPlayerState(a_Player)
if (not PlayerState:IsLoggedIn()) then
PlayerState:TeleportBack()
a_Player:GetClientHandle():Kick("The server reloaded while you were not logged in")
end
end
)
g_PassStorage:Disable()
end