Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.80 KB | None | 0 0
  1. ESX.UI.Menu.Open(
  2. 'dialog', GetCurrentResourceName(), 'cardgame',
  3. {
  4. title = 'Hur mycket vill du satsa?'
  5. },
  6. function(data, menu)
  7. local price = tonumber(data.value)
  8.  
  9. if price == nil then
  10. ESX.ShowNotification('Måste vara siffror')
  11. ESX.UI.Menu.CloseAll()
  12. else
  13. TriggerServerEvent('esx-vaggan-nightclub:takeMoneycardgame', price)
  14. ESX.UI.Menu.CloseAll()
  15. while tries < 3 do
  16. ESX.UI.Menu.Open(
  17. 'dialog', GetCurrentResourceName(), 'choosecard',
  18. {
  19. title = 'Välj en siffra mellan 1 och 13'
  20. },
  21. function(data2, menu2)
  22. local playerchoice = tonumber(data2.value)
  23. if playerchoice == computerchoice then
  24. TriggerEvent("pNotify:SendNotification", {
  25. text = 'Du gissade rätt',
  26. type = "success",
  27. queue = "records",
  28. timeout = 3000,
  29. layout = "bottomCenter"
  30. })
  31. ESX.UI.Menu.CloseAll()
  32. TriggerEvent("pNotify:SendNotification", {
  33. text = 'Du mottog din vinst på ' .. price*1.2 .. ' kr',
  34. type = "success",
  35. queue = "records",
  36. timeout = 3000,
  37. layout = "bottomCenter"
  38. })
  39. elseif playerchoice < computerchoice then
  40. TriggerEvent("pNotify:SendNotification", {
  41. text = 'För lågt',
  42. type = "success",
  43. queue = "records",
  44. timeout = 3000,
  45. layout = "bottomCenter"
  46. })
  47. tries=tries+1
  48. elseif playerchoice > computerchoice then
  49. TriggerEvent("pNotify:SendNotification", {
  50. text = 'För högt',
  51. type = "success",
  52. queue = "records",
  53. timeout = 3000,
  54. layout = "bottomCenter"
  55. })
  56. tries=tries+1
  57. end
  58. end
  59. )
  60. end
  61. end
  62. end
  63. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement