Lua 期望的语法是 "近似"(near) elseif。

当我尝试运行 elseif 时,返回了一个错误,要求我在 elseif 附近放置一个 =,但我之前使用过相同的方法,并没有出现问题。

``` 如果((GAMEPLAY.GET_DISTANCE_BETWEEN_COORDS(-629.99,-236.542,38.05,location.x,location.y,location.z,true)<2))那么 setMessage(“按 E 开始抢劫。”) --SelectPart(1)- 开始 heistP [1] elseif((startH == true)并且(jewelPart == false)&& (逃脱 == false)&& (dropoffP == false)) then

  heistP [2]
  --SelectPart(2)-- loadBlips

elseif((jewelPart == true)&&(逃脱 == false)&&(dropoffP == false)) then --SelectPart(3)--珠宝 elseif((逃脱 == true)&&(dropoffP == false)) then setMessage(“逃脱警察!”) --SelectPart(4)--EscapeC 否则(dropoffP == true)然后 --SelectPart(5)--DropOff 结束

heistP = { [1] = function() local playerPed = PLAYER.PLAYER_PED_ID() local location = ENTITY.GET_ENTITY_COORDS(playerPed,nil) 如果(get_key_pressed(Keys.E))则 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,

}

点赞
用户4962485
用户4962485

heistP[1]heistP[2]应该是heistP[1]()heistP[2]()。我假设heistP[2]()已经在其他地方定义了,如果没有,你需要定义它。

2015-06-05 10:17:49