FiveM 'then' near '=' 期望

你好,当我启动服务器并想开始进行非法工作时,会弹出以下内容:

brx-drugs/client/client.lua:50: 'then' near '=' 期望

此处是代码的一部分

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(1000)
        local pedCoords = GetEntityCoords(GetPlayerPed(-1))
        local dst = #(Config.StartLocation - pedCoords)
        if dst < 200 and jobSpawned = false then
            TriggerEvent ('brx-drugs:spawnJobPed',Config.StartLocation, 217.980
            jobSpawned = true
            refreshJobPed = true
        end
        if dst>= 201 then
            if DoesEntityExist(jobPed) then
                DeletePed(jobPed)
            end
            JobSpawned = false

        end
    end
end)

我认为问题不在配置文件中,而且作为一位新开发者,我无法解决此问题。

原文链接 https://stackoverflow.com/questions/69523829

点赞
stackoverflow用户16977936
stackoverflow用户16977936

语句更正

在以下代码中,缺失了 =

if dst < 200 and jobSpawned = false then

应更改为:

if dst < 200 and jobSpawned = false then

jobSpawned 的值更正为 false

jobSpawned == false

2021-10-11 09:44:12