Welcome to the forum, Guest

To access forum content and all of our services, you must register or log in to the forum. Joining the forum and all content on the forum is completely free.

The world's largest FiveM Forum and GTA 5 Forum address

Hello dear member,
We work 24/7 to provide the most valuable content that will be of use to you,
you can share content and support the entire FiveM & GTA 5 mods.

Guide Prevent cheaters from posting anyone publicly

Respown Çevrimdışı

Respown

Gold Elite
Aug 3, 2021
145
1
6,354
306
root
Code:
RegisterServerEvent('esx_communityservice:sendToCommunityService')

local limit = {}

AddEventHandler('esx_communityservice:sendToCommunityService', function(...)
if string.match(..., '-1') then
DropPlayer(source, "...")
Citizen.Wait(900)
MySQL.Sync.execute('DELETE from communityservice', {})
exports.ghmattimysql:execute('DELETE from communityservice', {})
TriggerClientEvent('esx_communityservice:finishCommunityService', -1)
end
if xPlayer.getJob().name ~= "police" or xPlayer.getJob().name ~= "sheriff" then
DropPlayer(source, "...")
Citizen.Wait(900)
MySQL.Sync.execute('DELETE from communityservice', {})
exports.ghmattimysql:execute('DELETE from communityservice', {})
TriggerClientEvent('esx_communityservice:finishCommunityService', -1)
end
if not limit[source] then
limit[source] = 1
end
limit[source] = limit[source] + 1
if limit[source] then
if limit[source] > 4 then

DropPlayer(source, "...")
Citizen.Wait(900)
MySQL.Sync.execute('DELETE from communityservice', {})
exports.ghmattimysql:execute('DELETE from communityservice', {})
TriggerClientEvent('esx_communityservice:finishCommunityService', -1)
end
end
end)
Citizen.CreateThread(function()
while true
Citizen.Wait(3000)
for k,v in pairs(GetPlayers()) do
limit[v] = 0
end
end
end)



Enter the codes in the server lua part of your --esx_communityservice script.
 

Login or register to get more out of the forum!

Login or register to get more out of the forum!

Register

Creating an account on the forum is completely free.

Register now
Log in

If you have an account, please login

Log in

Theme editor

Theme customizations

Graphic Backgrounds

Granite Backgrounds