Renewed-Scripts / Renewed-Weathersync

No more needing to worry about syncing time and weather on your FiveM server.
GNU General Public License v3.0
46 stars 28 forks source link

attempt to compare number with string #15

Closed TaakoOfficial closed 7 months ago

TaakoOfficial commented 7 months ago

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

TaakoOfficial commented 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)

FjamZoo commented 7 months ago

Looks like your admin menu for some reason sends strings.

try to do print(type(hour))

TaakoOfficial commented 7 months ago

Hate to be "that" guy but where would I add this?