Hello to all.
I bring here a script that I created, is very simple and for some it may be useful
Its main function is to kick the user that does not have the admin, superadmin or mod group when he tries to stop, start a server resource, it removes damage from all explosions, fire and also if a user has more money than allowed it kicks him, you can add logs that is in the same code the example to use it. By default it is disabled.
Learn about events before you use themā¦
First of all your event fx:acdontstop can be abused like this
for i=1, 10000 do
TriggerServerEvent('fx:acdontstop', i) -- you can kick every player
end
next one is source, its global variable on server, not client so your server event should looks like this
--RegisterNetEvent('fx:acdontstop') --its not net event
RegisterServerEvent('fx:acdontstop',function()
local source = source
local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer.getGroup() ~= 'owner' or xPlayer.getGroup() ~= 'superadmin' or xPlayer.getGroup() ~= 'admin' then
DropPlayer(source, 'Kicked for touching Server Resources')
end
end)
the āAnti Resource Stopperā triggers only if resource is stopped on ESX trigger but bad people can bypass this easy and stop it would prever like a heartbeat from resource to resource