Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. local vname = kitems[choice]
  2. if vname then
  3. local vehicle = vehicles[vname]
  4. if vehicle then
  5. local garagems = vRP.getUData(user_id,"vRP:garagems")
  6. local totalv = vRP.query("vRP/get_maxcars",{ user_id = user_id })
  7. if vRP.hasPermission(user_id,"bronze.permissao") then
  8. if parseInt(totalv[1].quantidade) >= parseInt(garagems) + 1 then
  9. TriggerClientEvent('chatMessage',source,"ALERTA",{255,70,50},"Você atingiu o número máximo de veículos em sua garagem.")
  10. return
  11. end
  12. elseif vRP.hasPermission(user_id,"prata.permissao") then
  13. if parseInt(totalv[1].quantidade) >= parseInt(garagems) + 3 then
  14. TriggerClientEvent('chatMessage',source,"ALERTA",{255,70,50},"Você atingiu o número máximo de veículos em sua garagem.")
  15. return
  16. end
  17. elseif vRP.hasPermission(user_id,"ouro.permissao") then
  18. if parseInt(totalv[1].quantidade) >= parseInt(garagems) + 5 then
  19. TriggerClientEvent('chatMessage',source,"ALERTA",{255,70,50},"Você atingiu o número máximo de veículos em sua garagem.")
  20. return
  21. end
  22. elseif vRP.hasPermission(user_id,"platina.permissao") then
  23. if parseInt(totalv[1].quantidade) >= parseInt(garagems) + 100 then
  24. TriggerClientEvent('chatMessage',source,"ALERTA",{255,70,50},"Você atingiu o número máximo de veículos em sua garagem.")
  25. return
  26. end
  27. else
  28. if parseInt(totalv[1].quantidade) >= parseInt(garagems) then
  29. TriggerClientEvent('chatMessage',source,"ALERTA",{255,70,50},"Você atingiu o número máximo de veículos em sua garagem.")
  30. return
  31. end
  32. end
  33. local ok = vRP.request(source,"Voce tem certeza que deseja comprar este veiculo?",30)
  34. if ok then
  35. if vRP.tryPayment(user_id,vehicle[2]) then
  36. vRP.execute("vRP/add_vehicle",{ user_id = user_id, vehicle = vname })
  37. TriggerClientEvent('chatMessage',source,"ALERTA",{255,70,50},"Você pagou ^1$"..vRP.format(parseInt(vehicle[2])).." ^0dólares.")
  38. vRP.closeMenu(source)
  39. else
  40. TriggerClientEvent('chatMessage',source,"ALERTA",{255,70,50},"Dinheiro insuficiente.")
  41. end
  42. else
  43. TriggerClientEvent('chatMessage',source,"ALERTA",{255,70,50},"Pedido recusado.")
  44. end
  45. end
  46. end
  47. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement