As the Oxide 1.18 plugin: http://oxidemod.org/resources/sleepers-location-prod.501/
I think it is a lot useful and should be ported to the Oxide 2.0 =p
Rust Legacy Sleeper locations
Discussion in 'Plugin Requests' started by MrPrzyr, May 12, 2015.
-
I agree, I was going to suggest this too.
-
Hey, I have a shitty solution for you:
Code:PLUGIN.Title = "Sleepers" PLUGIN.Description = "Saves sleeper locations" PLUGIN.Author = "mvrb" PLUGIN.Version = V(1, 0, 0) PLUGIN.ResourceId = _function PLUGIN:Init() ----------------------------- -- Chat Commands ----------------------------- command.AddChatCommand("sleeper", self.Object, "cmdSleepers") command.AddChatCommand("sleepers", self.Object, "cmdSleepers") command.AddChatCommand("s", self.Object, "cmdSleepers") ----------------------------- -- Variables ----------------------------- -- ChatName CN = "YourServerName" -- Sleepers self.sleepers = {} end----------------------------- -- Custom Functions ----------------------------- function PLUGIN:cmdSleepers( netuser, cmd ) if(netuser:CanAdmin()) then if (#self.sleepers > 0) then rust.SendChatMessage(netuser, CN, "--- start ---") local i = 1 while (self.sleepers[i]) do rust.SendChatMessage(netuser, self.sleepers[i]["name"], self.sleepers[i]["msg"]) i = i + 1 end rust.SendChatMessage(netuser, CN, "--- end ---") else -- No players have disconnected rust.SendChatMessage(netuser, CN, "[color #FF3D0D]No players have disconnected in the current session.") end end end function PLUGIN:AddSleeper( name, msg) local insert = {} insert["name"] = name insert["msg"] = msg table.insert(self.sleepers, insert) end----------------------------- -- AutoFunctions ----------------------------- function PLUGIN:OnPlayerDisconnected(networkplayer) local netuser = networkplayer:GetLocalData() local name = netuser.displayName local position = netuser.playerClient.lastKnownPosition if (#self.sleepers == 20) then table.remove(self.sleepers, 1) end -- Remove last line if 20 if(position.x ~= 0 and position.y ~= 0 and position.z ~= 0) then self:AddSleeper(netuser.displayName, math.ceil(position.x) .. " || " .. math.ceil(position.y) .. " || " .. math.ceil(position.z) .. " ||") print(netuser.displayName .. " disconnected here: teleport.topos mvrb " .. math.ceil(position.x) .. " " .. math.ceil(position.y) .. " " .. math.ceil(position.z)) end end
It will print it to the console though, so you could go through the logs and search for the last disconnect of a player.
Save the code as 'sleepers.lua'.