-- client
addEvent("Open", true)
addEventHandler("Open", root,
function ( )
guiSetVisible(GUIEditor.window[1], not guiGetVisible(GUIEditor.window[1]))
showCursor(guiGetVisible(GUIEditor.window[1]))
guiMoveRightToLeft(GUIEditor.window[1])
end )
TimeGuiSetRightC = { }
function guiMoveRightToLeft(gui)
if getElementData(gui,"HelhGui") == false then
setElementData(gui,"HelhGui",true)
local s1,s2=guiGetScreenSize()
local w1,w2=guiGetSize(gui,false)
local x,y = (s1-w1)/2,(s2-w2)/2
guiSetPosition(gui,-x,y,false)
TimeGuiSetRightC[gui] = setTimer(guiMoveRightToLeft,50,0,gui)
end
local a,b=guiGetScreenSize()
local w1,w2=guiGetSize(gui,false)
local x,y = (a-w1)/2,(b-w2)/2
local x1,y1 = guiGetPosition ( gui, false)
if (x1 >= x) then
killTimer(TimeGuiSetRightC[gui])
setElementData(gui,"HelhGui",false)
else
guiSetPosition(gui,x1+20,y,false)
end
end
--server
addComandHandler("open",
function ( player )
local accName = getAccountName( getPlayerAccount( player ) )
if isObjectInACLGroup( "user."..accName, aclGetGroup( "Console" ) ) then
triggerClientEvent( player, "Open", player )
end
end )
جرب