Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ESX = nil
- TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
- ESX.RegisterServerCallback('esx_marker:getUsergroup', function(source, cb)
- local xPlayer = ESX.GetPlayerFromId(source)
- local group = xPlayer.getGroup()
- cb(group)
- end)
- --[[
- Citizen.CreateThread(function()
- Citizen.Wait(1000)
- print('^7[^8MYTHIC_BASE ^7: ^8Startup^0] ^5Registering Admin Sync Commands^7')
- exports['mythic_chat']:AddAdminChatCommand('freeze', function(source, args, rawCommand)
- if args[1]:lower() == 'weather' or args[1]:lower() == 'time' then
- FreezeElement(args[1])
- else
- TriggerEvent('mythic_chat:server:Server', source, 'Invalid Argument')
- end
- end, {
- help = 'Freeze Weather or Time',
- params = {{
- name = 'Type',
- help = 'Weather or Time'
- }
- }
- }, 1)
- exports['mythic_chat']:AddAdminChatCommand('weather', function(source, args, rawCommand)
- for _, v in pairs(AvailableWeatherTypes) do
- if args[1]:upper() == v then
- SetWeather(args[1])
- return
- end
- end
- TriggerEvent('mythic_chat:server:Server', source, 'Invalid Argument')
- end, {
- help = 'Set Weather',
- params = {{
- name = 'Type',
- help = 'EXTRASUNNY, CLEAR, NEUTRAL, SMOG, FOGGY, OVERCAST, CLOUDS, CLEARING, RAIN, THUNDER, SNOW, BLIZZARD, SNOWLIGHT, XMAS, HALLOWEEN'
- }
- }
- }, 1)
- exports['mythic_chat']:AddAdminChatCommand('time', function(source, args, rawCommand)
- for _, v in pairs(AvailableTimeTypes) do
- if args[1]:upper() == v then
- SetTime(args[1])
- return
- end
- end
- TriggerEvent('mythic_chat:server:Server', source, 'Invalid Argument')
- end, {
- help = 'Set Time',
- params = {{
- name = 'Type',
- help = 'MORNING, NOON, EVENING, NIGHT'
- }
- }
- }, 1)
- exports['mythic_chat']:AddAdminChatCommand('clock', function(source, args, rawCommand)
- if tonumber(args[1]) ~= nil and tonumber(args[2]) ~= nil then
- SetExactTime(args[1], args[2])
- else
- TriggerEvent('mythic_chat:server:Server', source, 'Invalid Argument')
- end
- end, {
- help = 'Set Time To An Exact Hour & Minute',
- params = {{
- name = 'Hour',
- help = 'Number Between 0 - 23'
- },
- {
- name = 'Minute',
- help = 'Number Between 0 - 59'
- }
- }
- }, 2)
- exports['mythic_chat']:AddAdminChatCommand('blackout', function(source, args, rawCommand)
- ToggleBlackout()
- end, {
- help = 'Toggle Blackout'
- }, 0)
- end)
- ]]
- RegisterCommand('blackout', function(source)
- local xPlayer = ESX.GetPlayerFromId(source)
- local group = xPlayer.getGroup()
- playergroup = group
- if playergroup == 'admin' or playergroup == 'superadmin' or playergroup == 'mod' then
- ToggleBlackout()
- end
- end)
- RegisterCommand('time', function(source, args, rawCommand)
- local xPlayer = ESX.GetPlayerFromId(source)
- local group = xPlayer.getGroup()
- playergroup = group
- if playergroup == 'admin' or playergroup == 'superadmin' or playergroup == 'mod' then
- if tonumber(args[1]) ~= nil and tonumber(args[2]) ~= nil then
- SetExactTime(args[1], args[2])
- else
- print("Invalid syntax, correct syntax is: time <hour> <minute> !")
- end
- end
- end)
- RegisterCommand('weather', function(source, args)
- local xPlayer = ESX.GetPlayerFromId(source)
- local group = xPlayer.getGroup()
- playergroup = group
- if playergroup == 'admin' or playergroup == 'superadmin' or playergroup == 'mod' then
- local validWeatherType = false
- if args[1] == nil then
- print("Invalid syntax, correct syntax is: /weather <weathertype> ")
- return
- else
- for i,wtype in ipairs(AvailableWeatherTypes) do
- if wtype == string.upper(args[1]) then
- SetWeather(args[1])
- validWeatherType = true
- end
- end
- if validWeatherType then
- print("Weather has been updated.")
- else
- print("Invalid weather type, valid weather types are: \nEXTRASUNNY CLEAR NEUTRAL SMOG FOGGY OVERCAST CLOUDS ")
- print("CLEARING RAIN THUNDER SNOW BLIZZARD SNOWLIGHT XMAS ")
- print("HALLOWEEN ")
- end
- end
- end
- end)
- RegisterCommand('freezetw', function(source, args, rawCommand)
- local xPlayer = ESX.GetPlayerFromId(source)
- local group = xPlayer.getGroup()
- playergroup = group
- if playergroup == 'admin' or playergroup == 'superadmin' or playergroup == 'mod' then
- if args[1]:lower() == 'weather' or args[1]:lower() == 'time' then
- FreezeElement(args[1])
- else
- print("HUH?")
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement