Als kleinen Schnipsel hier noch etwas, um Wege zu versperren:
Code:
function OpenWallGatePermanently(_gate)
local s = "local oldPlayer = GUI.GetPlayerID(); GUI.SetControlledPlayer(Logic.EntityGetPlayer(" .. _gate .. "));";
if Logic.IsGateInAutomaticMode(_gate) then
s = s .. "GUI.SetGateAutomaticMode(" .. _gate .. ", false);";
end
Logic.ExecuteInLuaLocalState(s .. "GUI.OpenGate(" .. _gate .. "); GUI.SetControlledPlayer(oldPlayer);");
end
function CloseWallGatePermanently(_gate)
local s = "local oldPlayer = GUI.GetPlayerID(); GUI.SetControlledPlayer(Logic.EntityGetPlayer(" .. _gate .. "));";
if Logic.IsGateInAutomaticMode(_gate) then
s = s .. "GUI.SetGateAutomaticMode(" .. _gate .. ", false);";
end
Logic.ExecuteInLuaLocalState(s .. "GUI.CloseGate(" .. _gate .. "); GUI.SetControlledPlayer(oldPlayer);");
end
function ResetWallGate(_gate)
if not Logic.IsGateInAutomaticMode(_gate) then
Logic.ExecuteInLuaLocalState("local oldPlayer = GUI.GetPlayerID(); GUI.SetControlledPlayer(Logic.EntityGetPlayer(" .. _gate .. ")); GUI.SetGateAutomaticMode(" .. _gate .. ", true); GUI.SetControlledPlayer(oldPlayer);");
end
end
Es könnte danach aber möglicherweise Probleme mit der GUI oder ähnlichem geben - also auf jeden Fall testen!
Lesezeichen