Advertisement
Guest User

Untitled

a guest
Aug 19th, 2021
651
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. --client
  2.  
  3. Citizen.CreateThread(function()
  4. while true do
  5. Wait(30000)
  6. TriggerServerEvent('es_extended:saveLoadout',GetPlayerLoadout(PlayerPedId()))
  7. end
  8. end)
  9.  
  10. --server
  11.  
  12. local saveLoadout = {}
  13.  
  14. Citizen.CreateThread(function()
  15. while true do
  16. Wait(60000)
  17. local players = ESX.GetPlayers()
  18.  
  19. for i=1, #players, 1 do
  20. local xPlayer = ESX.GetPlayerFromId(players[i])
  21. if saveLoadout ~= xPlayer.loadout then
  22. --Ban event
  23. CancelEvent()
  24. break
  25. end
  26. end
  27. end
  28. end)
  29.  
  30. RegisterNetEvent('es_extended:saveLoadout')
  31. AddEventHandler('es_extended:saveLoadout',function(loadout)
  32. saveLoadout[source] = loadout
  33. end)
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement