Undzwar ich hab mal die fraktion redbrothers zu Region LS verschoben aber die gates lassen sich nicht erstellen.
Es kommen keine errors.
local gaterb = createObject(980, 2563, -980, 83.400001525879, 0, 0, 4)
local state = 1 -- Oben
local GTime2 = 0
local Jailrb = createObject(974, 2471.8000488281, -974.90002441406, 82, 0, 0, 268)
local Keyrb1rb = createObject(2886, 2472.6999511719, -979.59997558594, 79.300003051758, 271.99993896484, 180, 180)
local Jailstatus = 0
local Jailtime = 0
function resetJailRedbrothers()
Jailtime = 0
end
addEventHandler("onElementClicked", Keyrb1rb, function(theButton, theState, thePlayer)
outputChatBox("1")
if (theState == "down") and (theButton == "left") then
outputChatBox("2")
if (getDistanceBetweenElements(thePlayer, source) > 15) then return end
outputChatBox("3")
if(getPlayerFraktion(thePlayer) ~= 6) then return end
outputChatBox("4")
if(Jailtime == 1) then return end
if(Jailstatus == 0) then
outputChatBox("5")
Jailtime = 1
Jailstatus = 1
local X, Y, Z = getElementPosition(Jailrb)
moveObject(Jailrb, 1000, X, Y, Z-3, 0, 0, 0, "InOutQuad")
setTimer(resetJailRedbrothers, 1100, 1)
else
outputChatBox("6")
Jailtime = 1
Jailstatus = 0
local X, Y, Z = getElementPosition(Jail)
moveObject(Jailrb, 1000, X, Y, Z+3, 0, 0, 0, "InOutQuad")
setTimer(resetJailRedbrothers, 1100, 1)
end
end
end)
addCommandHandler("ogate",
function(thePlayer,cmd)
if (getPlayerFraktion(thePlayer) == 6) or (getPlayerFraktion(thePlayer) == 10) then else return end
if(GTime2 == 1) then return end
local x, y, z = getElementPosition(thePlayer)
if (getDistanceBetweenPoints3D ( x, y, z, 2563, -980, 83.400001525879 ) > 15) or ( x, y, z, 2434.6000976563, -972.70001220703, 81.199996948242 ) > 15) then return end
if(state == 1) then
local x, y, z = getElementPosition(gaterb)
moveObject(gaterb, 1500, x, y, z-6, 0, 0, 0, "InOutQuad")
state = 0
else
local x, y, z = getElementPosition(gaterb)
moveObject(gaterb, 1500, x, y, z+6, 0, 0, 0, "InOutQuad")
state = 1
end
GTime2 = 1
setTimer(function() GTime2 = 0 end, 1500, 1)
end)
Alles anzeigen