[FREE] Script Anti Resource Stop Start and More

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.

Sorry for my english :stuck_out_tongue:

Any problem I can provide support

DOWNLOAD:
Gifthub
Open Source

Or
fx_antiresourcestop.rar (2.1 KB)

Code is accessible Yes
Subscription-based No
Requirements ESX
Support Yes
2 Likes

can’t click on Gifthub (Github link)

1 Like

Sorry, now?

1 Like

yes thx

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)

and client

AddEventHandler('onResourceStop', function(resourceName)
    TriggerServerEvent('fx:acdontstop')
end)

Im not gonna mention how this code is useless and will make more problems than actual work

4 Likes

Sorry, I’m learning and it’s something that occurs to me that until now on my server hasn’t presented any problem.

1 Like

It’s not a good way to stop ā€œpeopleā€ from stopping your resources. The bad people already bypass these events :stuck_out_tongue:

2 Likes

No Requirements but using esx?

Esx IS a Requirement

My mistake sorry

You can delete this code and use the other

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