diff --git a/resources/[tools]/nordi_taxi/client/main.lua b/resources/[tools]/nordi_taxi/client/main.lua index 4084a0f93..be3c0ad4c 100644 --- a/resources/[tools]/nordi_taxi/client/main.lua +++ b/resources/[tools]/nordi_taxi/client/main.lua @@ -1,4 +1,4 @@ -local QBCore = exports['qb-core']:GetCoreObject() + local currentTaxi = nil local currentDriver = nil local taxiBlip = nil @@ -11,6 +11,22 @@ local taxiMeter = { pricePerKm = 0 } + +function DebugPrint(type, message) + if Config.Debug then + if type == "error" then + print("^1[TAXI DEBUG]^7 " .. message) + elseif type == "warning" then + print("^3[TAXI DEBUG]^7 " .. message) + else -- success/info + print("^2[TAXI DEBUG]^7 " .. message) + end + end +end + +local QBCore = exports['qb-core']:GetCoreObject() +local currentTaxi = nil + DebugPrint("^2[TAXI DEBUG]^7 Main script loaded") -- Taxi rufen Command @@ -1574,16 +1590,6 @@ AddEventHandler('onResourceStop', function(resourceName) end end) -function DebugPrint(type, message) - if Config.Debug then - if type == "error" then - print("^1[TAXI DEBUG]^7 " .. message) - elseif type == "warning" then - print("^3[TAXI DEBUG]^7 " .. message) - else -- success/info - print("^2[TAXI DEBUG]^7 " .. message) - end - end -end + diff --git a/resources/[tools]/nordi_taxi/client/stations.lua b/resources/[tools]/nordi_taxi/client/stations.lua index 6310ce4b6..1c5008d13 100644 --- a/resources/[tools]/nordi_taxi/client/stations.lua +++ b/resources/[tools]/nordi_taxi/client/stations.lua @@ -2,6 +2,23 @@ local QBCore = exports['qb-core']:GetCoreObject() local stationVehicles = {} local stationBlips = {} +function DebugPrint(type, message) + if Config.Debug then + if type == "error" then + print("^1[TAXI STATIONS DEBUG]^7 " .. message) + elseif type == "warning" then + print("^3[TAXI STATIONS DEBUG]^7 " .. message) + else -- success/info + print("^2[TAXI STATIONS DEBUG]^7 " .. message) + end + end +end + +local QBCore = exports['qb-core']:GetCoreObject() +local stationVehicles = {} + + + DebugPrint("^2[TAXI STATIONS DEBUG]^7 Stations script loaded") -- Taxi Stationen initialisieren @@ -1571,17 +1588,7 @@ AddEventHandler('onResourceStop', function(resourceName) end end) -function DebugPrint(type, message) - if Config.Debug then - if type == "error" then - print("^1[TAXI DEBUG]^7 " .. message) - elseif type == "warning" then - print("^3[TAXI DEBUG]^7 " .. message) - else -- success/info - orint("^2[TAXI DEBUG]^7 " .. message) - end - end -end + diff --git a/resources/[tools]/nordi_taxi/server/main.lua b/resources/[tools]/nordi_taxi/server/main.lua index 33763a698..8231a2081 100644 --- a/resources/[tools]/nordi_taxi/server/main.lua +++ b/resources/[tools]/nordi_taxi/server/main.lua @@ -1,5 +1,19 @@ + +function DebugPrint(type, message) + if Config.Debug then + if type == "error" then + print('^1[TAXI]^7 ' .. message) + elseif type == "warning" then + print('^3[TAXI]^7 ' .. message) + else -- success/info + print('^2[TAXI]^7 ' .. message) + end + end +end + local QBCore = exports['qb-core']:GetCoreObject() + RegisterNetEvent('taxi:payFare', function(amount) local src = source local Player = QBCore.Functions.GetPlayer(src) @@ -13,7 +27,7 @@ RegisterNetEvent('taxi:payFare', function(amount) TriggerClientEvent('QBCore:Notify', src, 'Du hast $' .. amount .. ' für die Taxifahrt bezahlt', 'success') -- Log für Admin - print('^2[TAXI]^7 ' .. Player.PlayerData.name .. ' (' .. src .. ') hat $' .. amount .. ' für eine Taxifahrt bezahlt') + DebugPrint('^2[TAXI]^7 ' .. Player.PlayerData.name .. ' (' .. src .. ') hat $' .. amount .. ' für eine Taxifahrt bezahlt') else local bankMoney = Player.PlayerData.money.bank if bankMoney >= amount then @@ -21,12 +35,12 @@ RegisterNetEvent('taxi:payFare', function(amount) TriggerClientEvent('QBCore:Notify', src, 'Du hast $' .. amount .. ' per Karte für die Taxifahrt bezahlt', 'success') -- Log für Admin - print('^2[TAXI]^7 ' .. Player.PlayerData.name .. ' (' .. src .. ') hat $' .. amount .. ' per Karte für eine Taxifahrt bezahlt') + DebugPrint('^2[TAXI]^7 ' .. Player.PlayerData.name .. ' (' .. src .. ') hat $' .. amount .. ' per Karte für eine Taxifahrt bezahlt') else TriggerClientEvent('QBCore:Notify', src, 'Du hast nicht genug Geld für die Taxifahrt!', 'error') -- Log für Admin - print('^1[TAXI]^7 ' .. Player.PlayerData.name .. ' (' .. src .. ') konnte $' .. amount .. ' für eine Taxifahrt nicht bezahlen') + DebugPrint('^1[TAXI]^7 ' .. Player.PlayerData.name .. ' (' .. src .. ') konnte $' .. amount .. ' für eine Taxifahrt nicht bezahlen') end end end)