I have a problem with my rule/help gui.
When I press f2 the window is not in the center, all the gui elements/buttons and memo are in the left corner then when i press f2 again, it opens up more windows.
I want the window to be in the center, same with the elements and the button to close the gui.
Here is my script:
Server-side
addEventHandler("onPlayerJoin", getRootElement(),
function()
bindKey (source, "f2", "down", serverWin )
end
)
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()),
function()
for index, player in pairs(getElementsByType("player")) do
unbindKey ( source, "f2", "down", serverWin )
end
end
)
function serverWin()
triggerClientEvent ( "server", getRootElement())
end
Client-side
function CreateRule()
GUIEditor_Window = {}
GUIEditor_Button = {}
rules = guiCreateWindow(194,108,426,400,"J World: Freeroam Service Window",false)
--Buttons
chg_pss = guiCreateButton(15,33,70,40,"change password",false,GUIEditor_Window[1])
chg_nick = guiCreateButton(95,35,70,40,"change nick",false,GUIEditor_Window[1])
lout = guiCreateButton(178,36,70,40,"Logout",false,GUIEditor_Window[1])
--Text
read_only = guiCreateMemo(17,92,398,100," Welcome to J World: Freeroam\n\n There is no rules on this server.\n\n All we ask is to be respectful to others and have FUN.",false,GUIEditor_Window[1])
guiMemoSetReadOnly(read_only,true)
guiCreateLabel(20,231,371,145,"COMING SOON!!!",false,GUIEditor_Window[1])
end