我在尝试运行elseif时需要返回一个错误,要求我在elseif附近放置=,但之前我使用了相同的方法,并且没有返回问题。
if ((GAMEPLAY.GET_DISTANCE_BETWEEN_COORDS( -629.99, -236.542, 38.05 , location.x, location.y, location.z, true ) < 2 )) then
setMessage("Press E to start the heist.")
--SelectPart(1) --start
heistP[1]
elseif ((startH == true) and (jewelPart == false) and (escape == false) and (dropoffP == false)) then
heistP[2]
--SelectPart(2) --loadBlips
elseif ((jewelPart == true) and (escape == false) and (dropoffP == false)) then
--SelectPart(3) -- Jewels
elseif ((escape == true) and (dropoffP == false)) then
setMessage("Escape the cops!")
--SelectPart(4) --EscapeC
elseif (dropoffP == true) then
--SelectPart(5) --DropOff
end
heistP = {
[1] = function()
local playerPed = PLAYER.PLAYER_PED_ID()
local location = ENTITY.GET_ENTITY_COORDS(playerPed, nil)
if(get_key_pressed(Keys.E))then
PLAYER.SET_PLAYER_WANTED_LEVEL(PLAYER.GET_PLAYER_PED(playerPed),3,false)
--PLAYER.SET_PLAYER_WANTED_LEVEL_NOW(PLAYER.GET_PLAYER_PED(playerPed),false)
PED.SET_PED_COMPONENT_VARIATION(playerPed, 9, 1, 0, 0)
startH = true
end
end,
}
heistP[1]
并且heistP[2]
应该是heistP[1]()
和heistP[2]()
。我假设heistP[2]()
是在其他地方定义的,如果没有定义,则需要定义它。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句