Update commands.lua

Minor changes to aop
This commit is contained in:
Andyyy7666
2021-12-24 22:31:22 +01:00
committed by GitHub
parent 43539708fe
commit 92b054f630

View File

@@ -5,37 +5,33 @@
-- For support join my discord: https://discord.gg/Z9Mxu72zZ6 -- -- For support join my discord: https://discord.gg/Z9Mxu72zZ6 --
------------------------------------------------------------------------ ------------------------------------------------------------------------
------------------------------------------------------------------------ ------------------------------------------------------------------------
local aop = "Unknown" -- aop unknown if it's not set.
-- Aop command -- Aop command events
if config.enableAopCommand then RegisterNetEvent("registerAop")
RegisterNetEvent("registerAop") AddEventHandler("registerAop", function(aopRegistered)
AddEventHandler("registerAop", function(aopRegistered) aop = aopRegistered
aop = aopRegistered TriggerClientEvent("setAop", -1, aop)
TriggerClientEvent("setAop", -1, aop) end)
end) RegisterNetEvent("getAop")
RegisterNetEvent("getAop") AddEventHandler("getAop", function()
AddEventHandler("getAop", function() local player = source
local player = source TriggerClientEvent("returnAop", player, aop)
if aop == nil then end)
aop = config.defaultAop
end
TriggerClientEvent("returnAop", player, aop)
end)
end
-- Twotter command -- Twotter command event
RegisterNetEvent("twt") RegisterNetEvent("twt")
AddEventHandler("twt", function(id, twtName, twt) AddEventHandler("twt", function(id, twtName, twt)
TriggerClientEvent("twt", -1, id, twtName, twt) TriggerClientEvent("twt", -1, id, twtName, twt)
end) end)
-- Me command -- Me command event
RegisterNetEvent("me") RegisterNetEvent("me")
AddEventHandler("me", function(id, name, msg, coords) AddEventHandler("me", function(id, name, msg, coords)
TriggerClientEvent("me", -1, id, name, msg, coords) TriggerClientEvent("me", -1, id, name, msg, coords)
end) end)
-- OOC command -- OOC command event
RegisterCommand("ooc", function(source, args, rawCommand) RegisterCommand("ooc", function(source, args, rawCommand)
TriggerClientEvent("chat:addMessage", -1, { TriggerClientEvent("chat:addMessage", -1, {
color = {150, 150, 150}, color = {150, 150, 150},
@@ -43,7 +39,7 @@ RegisterCommand("ooc", function(source, args, rawCommand)
}) })
end, false) end, false)
-- Darkweb command -- Darkweb command event
RegisterCommand("darkweb", function(source, args, rawCommand) RegisterCommand("darkweb", function(source, args, rawCommand)
TriggerClientEvent("chat:addMessage", -1, { TriggerClientEvent("chat:addMessage", -1, {
color = {0, 0, 0}, color = {0, 0, 0},