Closed TaakoOfficial closed 7 months ago
Here is the code that the admin menu uses
RegisterServerEvent("919-admin:server:SetTime", function(hour, minute) local src = source if AdminPanel.HasPermission(src, "time") then if QBCore then exports["qb-weathersync"]:setTime(hour, 0) TriggerClientEvent("919-admin:client:ShowPanelAlert", "success", "<strong>"..Lang:t("alerts.success").."</strong> "..Lang:t("alerts.setTime", {value = hour})) elseif ESX then TriggerClientEvent("919-admin:client:ShowPanelAlert", src, "error", "<strong>"..Lang:t("alerts.error").."</strong> This feature is currently unavailable!") end end end)
Looks like your admin menu for some reason sends strings.
try to do print(type(hour))
Hate to be "that" guy but where would I add this?
Summary
Admin menu we use uses numbers to set the time gives error
Reproduction
using 919 admin menu set the time gets error
Expected behavior
To set the time
Actual behavior
[script:Renewed-Weath] SCRIPT ERROR: @Renewed-Weathersync/server/time.lua:52: attempt to compare number with string [script:Renewed-Weath] > ref (@Renewed-Weathersync/server/time.lua:52) [script:Renewed-Weath] > ref (@Renewed-Weathersync/server/time.lua:52) [script:Renewed-Weath] > handler (@qb-admin/server/adminactions.lua:366) [script:Renewed-Weath] SCRIPT ERROR: @Renewed-Weathersync/server/time.lua:52: attempt to compare number with string [script:Renewed-Weath] > ref (@Renewed-Weathersync/server/time.lua:52) [script:Renewed-Weath] > ref (@Renewed-Weathersync/server/time.lua:52) [script:Renewed-Weath] SCRIPT ERROR: @Renewed-Weathersync/server/time.lua:52: attempt to compare number with string
Additional context
No response
Last Updated
yesterday
Resource Rename
No