-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcellTracker.lua
More file actions
23 lines (19 loc) · 896 Bytes
/
Copy pathcellTracker.lua
File metadata and controls
23 lines (19 loc) · 896 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--[[
Written by 'Rolf' for TES3MP 0.8.0/0.8.1.
Description: Easy way to know in which cell and region you are through the message box.
Steps:
1. Place this file inside 'server\scripts\custom' folder, located in your TES3MP directory.
2. Open 'customScripts.lua' file ('server\scripts') and write in it the next line: require('custom/cellTracker')
3. Save the changes and close it.
--]]
local function OnPlayerCellChange(_, pid)
local p = Players[pid]
if p and p:IsLoggedIn() then
local currCell, currRegion, prevCell = tes3mp.GetCell(pid), tes3mp.GetRegion(pid) or '?', p.previousCell
p.previousCell = currCell
if prevCell then
tes3mp.MessageBox(pid, -1, 'You moved from ['..prevCell..'] to ['..currCell..'] on '..currRegion)
end
end
end
customEventHooks.registerHandler('OnPlayerCellChange', OnPlayerCellChange)