Advertisement
Guest User

Untitled

a guest
Dec 13th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. local function TransformCoke(source)
  2.  
  3. if CopsConnected < Config.RequiredCopsCoke then
  4. TriggerClientEvent('customNotification', source, _U('act_imp_police') .. CopsConnected .. '/' .. Config.RequiredCopsCoke)
  5. return
  6. end
  7.  
  8. SetTimeout(10000, function()
  9.  
  10. if PlayersTransformingCoke[source] == true then
  11.  
  12. local xPlayer = ESX.GetPlayerFromId(source)
  13.  
  14. local cokeQuantity = xPlayer.getInventoryItem('coke').count
  15. local poochQuantity = xPlayer.getInventoryItem('coke_pooch').count
  16.  
  17. if poochQuantity > 30 then
  18. TriggerClientEvent('customNotification', source, _U('too_many_pouches'), 2000, true, 'error')
  19. elseif cokeQuantity > 150 then
  20. TriggerClientEvent('customNotification', source, _U('too_much_coke'), 2000, true, 'error')
  21. elseif cokeQuantity < 5 then
  22. TriggerClientEvent('customNotification', source, _U('not_enough_coke'), 2000, true, 'error')
  23. else
  24. xPlayer.removeInventoryItem('coke', 5)
  25. xPlayer.addInventoryItem('coke_pooch', 1)
  26.  
  27. TransformCoke(source)
  28. end
  29.  
  30. end
  31. end)
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement