Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Ghost deleting by Goomba
- -- Add this into record_server.lua file:
- addEvent("onGhostDataDelete", true)
- addEventHandler("onGhostDataDelete", g_Root,
- function(mapName)
- -- Delete current ghost
- if fileExists("ghosts/" .. mapName .. ".ghost") then
- fileDelete("ghosts/" .. mapName .. ".ghost")
- end
- -- Reinstall backup if exists
- if fileExists("ghosts/" .. mapName .. ".backup") then
- copyFile( "ghosts/" .. mapName .. ".backup", "ghosts/" .. mapName .. ".ghost" )
- end
- end
- )
- -- Replace the deletetime command in toptimes_server.lua file:
- addCommandHandler( "deletetime",
- function( player, cmd, place )
- if not _TESTING and not isPlayerInACLGroup(player, g_Settings.admingroup) then
- return
- end
- if g_SToptimesManager and g_SToptimesManager.mapTimes then
- local row = g_SToptimesManager.mapTimes:deletetime(place)
- if row then
- g_SToptimesManager:updateTopText()
- local mapName = tostring(g_SToptimesManager.mapTimes.mapName)
- local placeText = place and " #" .. tostring(place) or ""
- outputChatBox( "Top time"..placeText.." from '" .. tostring(row.playerName) .. "' deleted by " .. getPlayerName(player) )
- outputServerLog( "INFO: Top time"..placeText.." from '" ..tostring(row.playerName).. "' (" ..tostring(row.timeText).. " in " ..mapName.. ") deleted by " .. getAdminNameForLog(player) )
- -- Delete ghostdata
- if place == 1 then
- local currentMap = exports.mapmanager:getRunningGamemodeMap()
- local mapName = getResourceName( currentMap )
- triggerEvent("onGhostDataDelete", getRootElement(), mapName)
- end
- end
- end
- end
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement