ed
This commit is contained in:
parent
8110c00382
commit
05b2063db3
17 changed files with 1553 additions and 1 deletions
31
resources/[freizeit]/rubellose/client/c_main.lua
Normal file
31
resources/[freizeit]/rubellose/client/c_main.lua
Normal file
|
@ -0,0 +1,31 @@
|
|||
local cooldown = 0
|
||||
|
||||
RegisterNetEvent("dr-scratching:isActiveCooldown", function()
|
||||
TriggerServerEvent("dr-scratching:handler", cooldown > 0 and true or false, cooldown)
|
||||
end)
|
||||
|
||||
RegisterNetEvent("dr-scratching:setCooldown", function()
|
||||
cooldown = Config.ScratchCooldownInSeconds
|
||||
CreateThread(function()
|
||||
while (cooldown ~= 0) do
|
||||
Wait(1000)
|
||||
cooldown = cooldown - 1
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
RegisterNetEvent("dr-scratching:startScratchingEmote", function()
|
||||
if not IsPedInAnyVehicle(PlayerPedId()) then
|
||||
TaskStartScenarioInPlace(PlayerPedId(), "PROP_HUMAN_PARKING_METER", 0, true)
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent("dr-scratching:stopScratchingEmote", function()
|
||||
if not IsPedInAnyVehicle(PlayerPedId()) then
|
||||
ClearPedTasksImmediately(PlayerPedId())
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNUICallback('deposit', function(data)
|
||||
TriggerServerEvent('dr-scratching:deposit', data.key, data.price, data.amount, data.type)
|
||||
end)
|
30
resources/[freizeit]/rubellose/client/c_nui.lua
Normal file
30
resources/[freizeit]/rubellose/client/c_nui.lua
Normal file
|
@ -0,0 +1,30 @@
|
|||
local inMenu = false
|
||||
|
||||
RegisterNetEvent("dr-scratching:nuiOpenCard")
|
||||
AddEventHandler("dr-scratching:nuiOpenCard", function(key, price, amount, price_type, price_label)
|
||||
if inMenu then return end
|
||||
SetNuiFocus(true, true)
|
||||
SendNUIMessage({
|
||||
type = 'openScratch',
|
||||
key = key,
|
||||
price = price,
|
||||
amount = amount,
|
||||
price_type = price_type,
|
||||
price_label = price_label,
|
||||
win_message = "You Won!",
|
||||
lose_message = "You Lost :(",
|
||||
currency = "$",
|
||||
scratchAmount = Config.ScratchAmount,
|
||||
resourceName = GetCurrentResourceName(),
|
||||
debug = debugIsEnabled
|
||||
})
|
||||
inMenu = true
|
||||
end)
|
||||
|
||||
RegisterNUICallback('nuiCloseCard', function(data)
|
||||
SetNuiFocus(false, false)
|
||||
SendNUIMessage({type = 'closeScratch'})
|
||||
TriggerEvent("dr-scratching:stopScratchingEmote")
|
||||
TriggerServerEvent('dr-scratching:stopScratching', data.price, data.amount, data.type)
|
||||
inMenu = false
|
||||
end)
|
Loading…
Add table
Add a link
Reference in a new issue