Szerző Téma: Gate hiba  (Megtekintve 675 alkalommal)

Gate hiba
« Dátum: 2016. Május 04. - 16:53:03 »
0 Show voters
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 le
exports.pool:allocateElement(OMSZkapu)
local open = false
local which = 0
-- Gate code
function 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)
end
end
 
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)
        end
end
function resetState7()
        open = false
end
« Utoljára szerkesztve: 2016. Május 04. - 16:55:17 írta ZalanHD »

Gate hiba
« Válasz #1 Dátum: 2016. Május 30. - 20:41:22 »
0 Show voters
Idézetet írta: ZalanHD date=1462373583\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"60296\" data-ipsquote-contentclass=\"forums_Topic
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 le
exports.pool:allocateElement(OMSZkapu)
local open = false
local which = 0
-- Gate code
function 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)
end
end
 
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)
        end
end
function resetState7()
        open = false
end

 

Debugscript?

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal