inferno-collection / Fire-Alarm

A resource that adds Fire Alarms into FiveM.
https://inferno-collection.com/fire-alarm
Other
10 stars 14 forks source link

[Bug]client.lua error #12

Closed kielerboy closed 4 years ago

kielerboy commented 4 years ago

hello i used the script with esx setup i habe this error on client log

[   1206125] [    GTAProcess]             MainThrd/ Error parsing script @inferno-fire-alarm/client.lua in resource inferno-fire-alarm: @inferno-fire-alarm/client.lua:850: unexpected symbol near 'then'
[   1206140] [    GTAProcess]             MainThrd/ Failed to load script client.lua.

here is the code

-- If panel not already in use and if E just pressed
        if IsControlJustReleased(0, 38) and PlayerData.job ~= nil and PlayerData.job.name == "fire" and then
    if not FirePanel.Enabled then
            -- Loop though all control panels
            for _, Panel in ipairs(FirePanel.ControlPanels) do
                -- Player position
                local PP = GetEntityCoords(PlayerPedId(), false)
                -- Panel position
                local CPP = vector3(Panel.x, Panel.y, Panel.z)
                -- Distance between player and panel
                local Distance = Vdist(PP.x, PP.y, PP.z, CPP.x, CPP.y, CPP.z)
                -- If player is face-to-face with panel
                if Distance < 1.7 then
                    -- Send panel to server
                    TriggerServerEvent("Fire-Panel:OpenPanel", Panel)
                    -- Set enabled locally so it is not opened twice
                    FirePanel.Open = true
                end
            end
        end
        end