Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ****************************************************************************
- --
- -- RECURSO: MJ-Core
- -- ARCHIVO: servidor/main.lua
- -- PROPOSITO: Funcionamiento del recurso por parte del servidor
- -- CREADORES: Tomas Andres Navarro < GamerCarl >
- --
- -- ****************************************************************************
- local rroot = getResourceRootElement()
- main = {}
- main.modulos = { 'MJ-Niveles', 'MJ-System', 'MJ-VIP', 'MJ-Grupos', 'C-BUG', 'scoreboard', 'mapmanager', 'votemanager', 'MTAUtil' } --Tabla de recursos
- -- Inicio de recurso
- function main.inicio ()
- -- Se cierran todas las cuentas
- for k,v in ipairs(getElementsByType('player')) do
- logOut(v)
- end
- outputDebugString('[MJ] Iniciando Recursos...')
- -- Iniciamos los recursos planteados en la tabla
- for k,v in ipairs ( main.modulos ) do
- local rec = getResourceFromName ( v )
- if rec then
- startResource ( rec )
- else
- --Si un script no puede iniciar se le informara a la consola u debugscript
- outputDebugString('[MJ] No se pudo iniciar ' .. v)
- end
- end
- -- Confirmamos que los scripts del servidor cargaron correctamente
- outputDebugString('[MJ] Modo iniciado satisfactoriamente.')
- end
- addEventHandler('onResourceStart', resourceRoot, main.inicio, false)
- -- Detención del recurso
- function main.detener ()
- --Detiene los recursos de la tabla al detener el core
- for k,v in ipairs ( main.modulos ) do
- local rec = getResourceFromName ( v )
- if rec then
- stopResource ( rec )
- end
- end
- end
- addEventHandler("onResourceStart", rroot, function()
- setMapName("Los Santos") -- Se cambia el mapa que se muestre en el buscador de servidores
- setTimer(function()
- setGameType("Mini Juegos v"..getResourceInfo(getThisResource(), "version"))
- end, 2000, 1)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement