mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-31 04:51:40 +09:00
Added command_auth_runtime_disable
This commit is contained in:
46
old/modules/DONE/DeathMarkers/control.lua
Normal file
46
old/modules/DONE/DeathMarkers/control.lua
Normal file
@@ -0,0 +1,46 @@
|
||||
--- Adds markers to the map when a player dies and removes it when the body is removed.
|
||||
-- @module DeathMarkers@4.0.0
|
||||
-- @author Cooldude2606
|
||||
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||
-- @alias ThisModule
|
||||
|
||||
-- Module Define
|
||||
local module_verbose = false
|
||||
local ThisModule = {}
|
||||
|
||||
-- Global Define
|
||||
local global = {
|
||||
corpses={}
|
||||
}
|
||||
Global.register(global,function(tbl) global = tbl end)
|
||||
|
||||
-- Event Handlers Define
|
||||
Event.add(defines.events.on_player_died, function(event)
|
||||
local player = game.players[event.player_index]
|
||||
local tag = player.force.add_chart_tag(player.surface,{
|
||||
position=player.position,
|
||||
text='Death: '..player.name..' ('..tick_to_display_format(event.tick)..')'
|
||||
})
|
||||
if not global.corpses then global.corpses = {} end
|
||||
table.insert(global.corpses,tag)
|
||||
end)
|
||||
|
||||
Event.add(defines.events.on_tick, function(event)
|
||||
if (game.tick%3600) ~= 0 then return end
|
||||
if not global.corpses then global.corpses = {} end
|
||||
local key = 1
|
||||
while key <= #global.corpses do
|
||||
local tag = global.corpses[key]
|
||||
if not tag or not tag.valid then table.remove(global.corpses,key) else
|
||||
if not tag.target then
|
||||
local entity = tag.surface.find_entity('character-corpse',tag.position)
|
||||
if entity then tag.target = entity
|
||||
else tag.destroy() table.remove(global.corpses,key) key=key-1 end
|
||||
elseif not tag.target.valid then tag.destroy() table.remove(global.corpses,key) key=key-1 end
|
||||
end
|
||||
key=key+1
|
||||
end
|
||||
end)
|
||||
|
||||
-- Module Return
|
||||
return ThisModule
|
||||
17
old/modules/DONE/DeathMarkers/softmod.json
Normal file
17
old/modules/DONE/DeathMarkers/softmod.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "DeathMarkers",
|
||||
"version": "4.0.0",
|
||||
"description": "Adds markers to the map when a player dies and removes it when the body is removed.",
|
||||
"location": "FSM_ARCHIVE",
|
||||
"keywords": [
|
||||
"Death",
|
||||
"Marker",
|
||||
"Body",
|
||||
"Map"
|
||||
],
|
||||
"author": "Cooldude2606",
|
||||
"contact": "Discord: Cooldude2606#5241",
|
||||
"license": "https://github.com/explosivegaming/scenario/blob/master/LICENSE",
|
||||
"dependencies": {},
|
||||
"submodules": {}
|
||||
}
|
||||
Reference in New Issue
Block a user