Szerző Téma: Gate System probléma  (Megtekintve 568 alkalommal)

Gate System probléma
« Dátum: 2017. Június 30. - 23:30:50 »
0
Sziasztok! Az a probléma hogy csak 1x működik a script. Tehát egyszer megengedi hogy /fel és egyszer hogy /le és utána csak egy resources restart után engedi ujra. Ez miért van? Előre is köszönöm.
 
 
 
local objGates = createObject(2779, 1775.8000488281, -2059.3999023438, 12.60000038147, 0, 0, 0)
exports.pool:allocateElement(objGates)
 
local open = false
local which = 0
 
-- Gate code
function useSESideGarageGate(thePlayer)
    local x, y, z = getElementPosition(thePlayer)
    local distance1 = getDistanceBetweenPoints3D(1775.8000488281, -2059.3999023438, 12.60000038147, x, y, z)
 
    if (distance1<=10) and (open==false) then
        if (exports.global:hasItem(thePlayer, 108) or exports.global:hasItem(thePlayer, 82)) then
            open = true
            which = 1
            outputChatBox(\"Szerelő lift felemelve!\", thePlayer, 0, 255, 0)
            moveObject(objGates, 1000, 1775.8000488281, -2059.3999023438, 14.5, 0, 0, 0)
        end
    end
end
addCommandHandler(\"fel\", useSESideGarageGate)
 
function closeSESideGarageGate(thePlayer)
    if (which==1) then
        which = 0
        outputChatBox(\"Szerelő lift leengedve!\", thePlayer, 0, 255, 0)
        moveObject(objGates, 1000, 1775.8000488281, -2059.3999023438, 12.60000038147, 0, 0, 0)
    end
end
addCommandHandler(\"le\", closeSESideGarageGate)
 
function resetState7()
    open = false
end
 
 

Gate System probléma
« Válasz #1 Dátum: 2017. Július 01. - 02:08:39 »
+1
Nem rakod vissza az open-t false-ra.

Gate System probléma
« Válasz #2 Dátum: 2017. Július 01. - 12:42:10 »
0
Köszönöm! Megoldottam. Kitöröltem az            open = true  sort, és most működik és a playerek sem tudják használni!

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal