So, Basically I have a thread which triggers server event
Citizen.CreateThread(function()
while true do
Wait(0)
TriggerServerEvent("ServerMode")
end
end)
Now on the server, I have This, which should filter out people are trigger event for those who don’t match, or non admins.
RegisterServerEvent('ServerMode')
AddEventHandler('ServerMode', function()
if not IsAdmin(source) then
TriggerClientEvent("ServerModeFiltered", source)
end
end)
and back to client side
RegisterNetEvent('ServerModeFiltered')
AddEventHandler('ServerModeFiltered', function()
RemoveAllPedWeapons(source, false) -- Or just any native, it doesn't seem to trigger
end)
But this doesn’t really work, is there way to properly do this?