Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ESX.UI.Menu.Open(
- 'dialog', GetCurrentResourceName(), 'cardgame',
- {
- title = 'Hur mycket vill du satsa?'
- },
- function(data, menu)
- local price = tonumber(data.value)
- if price == nil then
- ESX.ShowNotification('Måste vara siffror')
- ESX.UI.Menu.CloseAll()
- else
- TriggerServerEvent('esx-vaggan-nightclub:takeMoneycardgame', price)
- ESX.UI.Menu.CloseAll()
- while tries < 3 do
- ESX.UI.Menu.Open(
- 'dialog', GetCurrentResourceName(), 'choosecard',
- {
- title = 'Välj en siffra mellan 1 och 13'
- },
- function(data2, menu2)
- local playerchoice = tonumber(data2.value)
- if playerchoice == computerchoice then
- TriggerEvent("pNotify:SendNotification", {
- text = 'Du gissade rätt',
- type = "success",
- queue = "records",
- timeout = 3000,
- layout = "bottomCenter"
- })
- ESX.UI.Menu.CloseAll()
- TriggerEvent("pNotify:SendNotification", {
- text = 'Du mottog din vinst på ' .. price*1.2 .. ' kr',
- type = "success",
- queue = "records",
- timeout = 3000,
- layout = "bottomCenter"
- })
- elseif playerchoice < computerchoice then
- TriggerEvent("pNotify:SendNotification", {
- text = 'För lågt',
- type = "success",
- queue = "records",
- timeout = 3000,
- layout = "bottomCenter"
- })
- tries=tries+1
- elseif playerchoice > computerchoice then
- TriggerEvent("pNotify:SendNotification", {
- text = 'För högt',
- type = "success",
- queue = "records",
- timeout = 3000,
- layout = "bottomCenter"
- })
- tries=tries+1
- end
- end
- )
- end
- end
- end
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement