Hallöchen, ich versuche schon seit langer Zeit ein ereigniss aus einem Skript(Das für die Diamanten-Bildschirme zuständig ist) aktivieren zulassen, wenn der Spieler Tokens kauft und beim Verkaufen der Tokens Deaktiviert wird. Bitte dort um hilfe weil ich neu im LUA Skripten bin M.F.G Don_Goldi
Das Diamantenregen Skript:
GitHub - charleshacks/chCasinoWall: Working Diamond Casino video wall for FiveM.
Die Stelle in dem Skript in dem ich es einfügen möchte
So habe ich es versucht:
TriggerEvent('chCasinoWall:enteredCasino')
TriggerEvent('chCasinoWall:exitedCasino')
Viel Dank für alle Antworten :)
RegisterServerEvent("route68_kasyno:WymienZetony")
AddEventHandler("route68_kasyno:WymienZetony", function(count)
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
local societyAccount = nil
if xPlayer then
local xItem = xPlayer.getInventoryItem('zetony')
if xItem.count < count then
TriggerClientEvent('pNotify:SendNotification', _source, {text = 'Du hast nicht genug Chips!'})
elseif xItem.count >= count then
local kwota = math.floor(count * 5)
xPlayer.removeInventoryItem('zetony', count)
xPlayer.addMoney(kwota)
TriggerEvent('chCasinoWall:exitedCasino')
TriggerClientEvent('pNotify:SendNotification', _source, {text = 'Du bekommst $'..kwota..' gegen '..count..' Chips.'})
TriggerEvent(' esx_addonaccount:getSharedAccount', 'society_casino', function(account)
societyAccount = account
end)
societyAccount.removeMoney(kwota)
end
end
end)
RegisterServerEvent("route68_kasyno:KupZetony")
AddEventHandler("route68_kasyno:KupZetony", function(count)
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
local societyAccount = nil
if xPlayer then
local cash = xPlayer.getMoney()
local kwota = math.floor(count * 5)
if kwota > cash then
TriggerClientEvent('pNotify:SendNotification', _source, {text = 'Du hast nicht genug Geld!'})
elseif kwota <= cash then
xPlayer.addInventoryItem('zetony', count)
xPlayer.removeMoney(kwota)
TriggerEvent('chCasinoWall:enteredCasino')
TriggerClientEvent('pNotify:SendNotification', _source, {text = 'Du bekommst '..count..' Chips für $'..kwota..'.'})
TriggerEvent('esx_addonaccount:getSharedAccount', 'society_casino', function(account)
societyAccount = account
end)
societyAccount.addMoney(kwota)
end
end
end)