local OMSZkapu = createObject(968, 1142.86353, -1291.13574, 13.29300, 0.00000, 90.00000, 0.50000) --Ez helyezi leexports.pool:allocateElement(OMSZkapu)local open = falselocal which = 0-- Gate codefunction useOMSZGate(thePlayer) --Ez nyitja ki local x, y, z = getElementPosition(thePlayer) local distance1 = getDistanceBetweenPoints3D(1142.86353, -1291.13574, 13.29300, x, y, z) --Melyik ponttól érzékelje a hatótávolságot if (distance1<=10) and (open==false) then if (exports.global:hasItem(thePlayer, 65) or exports.global:hasItem(thePlayer, 108) or exports.global:hasItem(thePlayer, 82)) then open = true which = 1 outputChatBox(\"Sorompó nyitva!\", thePlayer, 0, 255, 0) moveObject(OMSZkapu, 1000, 1142.86353, -1291.13574, 13.29300, 0, -90, 0) end setTimer(closePDSideGarageGate, 5000, 1, thePlayer)endend addCommandHandler(\"gate\", useOMSZGate)function closeOMSZGate(thePlayer) --Ez csukja be setTimer(resetState7, 1000, 1) if (which==1) then which = 0 moveObject(OMSZkapu, 1000, 1142.86353, -1291.13574, 13.29300, 0.00000, 90.00000, 0) endendfunction resetState7() open = falseend
Sziasztok mi lehet ebbe a code-ba a hiba?Én nézegettem de nem találom előre is köszi a segítséget! local OMSZkapu = createObject(968, 1142.86353, -1291.13574, 13.29300, 0.00000, 90.00000, 0.50000) --Ez helyezi leexports.pool:allocateElement(OMSZkapu)local open = falselocal which = 0-- Gate codefunction useOMSZGate(thePlayer) --Ez nyitja ki local x, y, z = getElementPosition(thePlayer) local distance1 = getDistanceBetweenPoints3D(1142.86353, -1291.13574, 13.29300, x, y, z) --Melyik ponttól érzékelje a hatótávolságot if (distance1<=10) and (open==false) then if (exports.global:hasItem(thePlayer, 65) or exports.global:hasItem(thePlayer, 108) or exports.global:hasItem(thePlayer, 82)) then open = true which = 1 outputChatBox(\"Sorompó nyitva!\", thePlayer, 0, 255, 0) moveObject(OMSZkapu, 1000, 1142.86353, -1291.13574, 13.29300, 0, -90, 0) end setTimer(closePDSideGarageGate, 5000, 1, thePlayer)endend addCommandHandler(\"gate\", useOMSZGate)function closeOMSZGate(thePlayer) --Ez csukja be setTimer(resetState7, 1000, 1) if (which==1) then which = 0 moveObject(OMSZkapu, 1000, 1142.86353, -1291.13574, 13.29300, 0.00000, 90.00000, 0) endendfunction resetState7() open = falseend