Jump to content

Rules gui


Bleidex

Recommended Posts

Hey,

I wanted to make Rules gui. I want that it would start after login_register script, but with my script it shoudl start in same time. But it doesnt start. What I made wrong?

function CreateRulesWindow()
 
GUIEditor_Window[1] = guiCreateWindow(204,151,618,464,"Rules",false)
       guiSetVisible( wdwLogin, false )
       guiWindowSetMovable( wdwLogin, false )
       guiWindowSetSizable( wdwLogin, false )
 
GUIEditor_Button[1] = guiCreateButton(118,419,97,24,"Accept",true,GUIEditor_Window[1])
 
GUIEditor_Button[2] = guiCreateButton(370,418,110,24,"Cancel",true,GUIEditor_Window[1])
 
GUIEditor_Label[1] = guiCreateLabel(57,51,506,344,"Rules:",true,GUIEditor_Window[1])
guiLabelSetColor(GUIEditor_Label[1],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[1],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",true)
 
GUIEditor_Label[2] = guiCreateLabel(1,28,141,19,"-No Cheating",true,GUIEditor_Label[1])
guiLabelSetColor(GUIEditor_Label[2],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[2],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[2],"left",true)
 
GUIEditor_Label[3] = guiCreateLabel(1,50,72,19,"-No Swearing",true,GUIEditor_Label[1])
guiLabelSetColor(GUIEditor_Label[3],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[3],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[3],"left",true)
 
GUIEditor_Label[4] = guiCreateLabel(1,73,70,16,"-English Only",true,GUIEditor_Label[1])
guiLabelSetColor(GUIEditor_Label[4],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[4],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[4],"left",true)
 
GUIEditor_TabPanel[1] = guiCreateTabPanel(5,115,495,225,true,GUIEditor_Label[1])
 
GUIEditor_Tab[1] = guiCreateTab("Exceptions",GUIEditor_TabPanel[1])
 
GUIEditor_Label[5] = guiCreateLabel(10,13,469,177,"Exeptions:",true,GUIEditor_Tab[1])
guiLabelSetColor(GUIEditor_Label[5],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[5],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[5],"left",true)
 
GUIEditor_Label[6] = guiCreateLabel(1,22,267,19,"-You can talk other language if You are in -GTD-",true,GUIEditor_Label[5])
guiLabelSetColor(GUIEditor_Label[6],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[6],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[6],"left",true)
 
GUIEditor_Tab[2] = guiCreateTab("-GTD-Members",GUIEditor_TabPanel[1])
 
GUIEditor_Label[7] = guiCreateLabel(18,16,118,18,"Leaders:",true,GUIEditor_Tab[2])
guiLabelSetColor(GUIEditor_Label[7],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[7],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[7],"left",true)
 
GUIEditor_Label[8] = guiCreateLabel(69,17,77,17,"Bleidex",true,GUIEditor_Tab[2])
guiLabelSetColor(GUIEditor_Label[8],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[8],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[8],"left",true)
 
GUIEditor_Label[9] = guiCreateLabel(16,43,455,20,"Co-Leaders: -",true,GUIEditor_Tab[2])
guiLabelSetColor(GUIEditor_Label[9],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[9],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[9],"left",true)
 
GUIEditor_Label[10] = guiCreateLabel(18,73,444,20,"Full Members: -",true,GUIEditor_Tab[2])
guiLabelSetColor(GUIEditor_Label[10],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[10],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[10],"left",true)
 
GUIEditor_Label[11] = guiCreateLabel(17,107,462,22,"Trial members: Anna    Denon",true,GUIEditor_Tab[2])
guiLabelSetColor(GUIEditor_Label[11],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[11],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[11],"left",true)
 
GUIEditor_Label[12] = guiCreateLabel(149,23,326,80,"www.gtd.wu.lt",true,GUIEditor_Label[1])
guiLabelSetColor(GUIEditor_Label[12],0,50,255)
guiLabelSetVerticalAlign(GUIEditor_Label[12],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[12],"left",true)
guiSetFont(GUIEditor_Label[12],"sa-header")
 
   addEventHandler( "onClientGUIClick", Cancel, CloseLoginWindow, false )
 
end
 
function openLoginWindow()
 
guiSetVisible( wdwLogin, true )
   showCursor( true )
 
addEventHandler("onClientResourceStart",getResourceRootElement(),GUIEditor_Window[1])
 
end
 
function closeLoginWindow()
 
   guiSetVisible( wdwLogin, false )
   showCursor( false )
 
end

Link to comment
--remove this line
addEventHandler("onClientResourceStart",getResourceRootElement(),GUIEditor_Window[1])
--add this line on the last line of your script
addEventHandler("onClientResourceStart",getResourceRootElement(),CreateRulesWindow)
 
--next:
--add this line as the last line of CreateRulesWindow function
openLoginWindow()

not tested, but should work if everything else is correct (i not looked through all the script)

next time put your code in [lua ] [/lua ] tags, not the

greets

Link to comment

This code has so many errors that it'd take me way too long to correct them for you...

1. All your guiCreate... functions have wrong argument which is true. Why is that? Because it looks like, coords and size of elements use non-relative coords but the true tells the function to use relative coords. That will create elements so far away that you'll never see them. If you haven't changed it yourself then tell author of the gui editor to fix this bug.

2. You're trying to attach event handler to Cancel, but what is Cancel? It's not declared anywhere.

3. You're trying to show wdnLogin but that's the same problem.. It's not declared anywhere so it's nil.

This is all I noticed but there is probably more...

Link to comment

function CreateRulesWindow()
 
GUIEditor_Window[1] = guiCreateWindow(204,151,618,464,"Rules",false)
       guiSetVisible( GUIEditor_Window[1], false )
       guiWindowSetMovable( GUIEditor_Window[1], false )
       guiWindowSetSizable( GUIEditor_Window[1], false )
 
GUIEditor_Button[1] = guiCreateButton(118,419,97,24,"Accept",true,GUIEditor_Window[1])
 
GUIEditor_Button[2] = guiCreateButton(370,418,110,24,"Cancel",true,GUIEditor_Window[1])
 
GUIEditor_Label[1] = guiCreateLabel(57,51,506,344,"Rules:",true,GUIEditor_Window[1])
guiLabelSetColor(GUIEditor_Label[1],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[1],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",true)
 
GUIEditor_Label[2] = guiCreateLabel(1,28,141,19,"-No Cheating",true,GUIEditor_Label[1])
guiLabelSetColor(GUIEditor_Label[2],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[2],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[2],"left",true)
 
GUIEditor_Label[3] = guiCreateLabel(1,50,72,19,"-No Swearing",true,GUIEditor_Label[1])
guiLabelSetColor(GUIEditor_Label[3],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[3],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[3],"left",true)
 
GUIEditor_Label[4] = guiCreateLabel(1,73,70,16,"-English Only",true,GUIEditor_Label[1])
guiLabelSetColor(GUIEditor_Label[4],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[4],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[4],"left",true)
 
GUIEditor_TabPanel[1] = guiCreateTabPanel(5,115,495,225,true,GUIEditor_Label[1])
 
GUIEditor_Tab[1] = guiCreateTab("Exceptions",GUIEditor_TabPanel[1])
 
GUIEditor_Label[5] = guiCreateLabel(10,13,469,177,"Exeptions:",true,GUIEditor_Tab[1])
guiLabelSetColor(GUIEditor_Label[5],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[5],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[5],"left",true)
 
GUIEditor_Label[6] = guiCreateLabel(1,22,267,19,"-You can talk other language if You are in -GTD-",true,GUIEditor_Label[5])
guiLabelSetColor(GUIEditor_Label[6],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[6],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[6],"left",true)
 
GUIEditor_Tab[2] = guiCreateTab("-GTD-Members",GUIEditor_TabPanel[1])
 
GUIEditor_Label[7] = guiCreateLabel(18,16,118,18,"Leaders:",true,GUIEditor_Tab[2])
guiLabelSetColor(GUIEditor_Label[7],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[7],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[7],"left",true)
 
GUIEditor_Label[8] = guiCreateLabel(69,17,77,17,"Bleidex",true,GUIEditor_Tab[2])
guiLabelSetColor(GUIEditor_Label[8],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[8],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[8],"left",true)
 
GUIEditor_Label[9] = guiCreateLabel(16,43,455,20,"Co-Leaders: -",true,GUIEditor_Tab[2])
guiLabelSetColor(GUIEditor_Label[9],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[9],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[9],"left",true)
 
GUIEditor_Label[10] = guiCreateLabel(18,73,444,20,"Full Members: -",true,GUIEditor_Tab[2])
guiLabelSetColor(GUIEditor_Label[10],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[10],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[10],"left",true)
 
GUIEditor_Label[11] = guiCreateLabel(17,107,462,22,"Trial members: Anna    Denon",true,GUIEditor_Tab[2])
guiLabelSetColor(GUIEditor_Label[11],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[11],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[11],"left",true)
 
GUIEditor_Label[12] = guiCreateLabel(149,23,326,80,"www.gtd.wu.lt",true,GUIEditor_Label[1])
guiLabelSetColor(GUIEditor_Label[12],0,50,255)
guiLabelSetVerticalAlign(GUIEditor_Label[12],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[12],"left",true)
guiSetFont(GUIEditor_Label[12],"sa-header")
 
   addEventHandler( "onClientGUIClick", Cancel, CloseLoginWindow, false )
 
openLoginWindow()
 
end
 
function openLoginWindow()
 
guiSetVisible( wdwLogin, true )
   showCursor( true )
 
end
 
function closeLoginWindow()
 
   guiSetVisible( wdwLogin, false )
   showCursor( false )
 
end
 
addEventHandler("onClientResourceStart",getResourceRootElement(),CreateRulesWindow)
 
end

I tried this, but i still doesnt work. Any help please?

Link to comment

tried to fix something, but still need help. and also idk how to make that if they click cancel, they would be kicked. any ideas?

function CreateRulesWindow()
 
GUIEditor_Window[1] = guiCreateWindow(204,151,618,464,"Rules",false)
       guiSetVisible( GUIEditor_Window[1], false )
       guiWindowSetMovable( GUIEditor_Window[1], false )
       guiWindowSetSizable( GUIEditor_Window[1], false )
 
GUIEditor_Button[1] = guiCreateButton(118,419,97,24,"Accept",true,GUIEditor_Window[1])
 
GUIEditor_Button[2] = guiCreateButton(370,418,110,24,"Cancel",true,GUIEditor_Window[1])
 
GUIEditor_Label[1] = guiCreateLabel(57,51,506,344,"Rules:",true,GUIEditor_Window[1])
guiLabelSetColor(GUIEditor_Label[1],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[1],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false)
 
GUIEditor_Label[2] = guiCreateLabel(1,28,141,19,"-No Cheating",true,GUIEditor_Label[1])
guiLabelSetColor(GUIEditor_Label[2],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[2],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[2],"left",false)
 
GUIEditor_Label[3] = guiCreateLabel(1,50,72,19,"-No Swearing",true,GUIEditor_Label[1])
guiLabelSetColor(GUIEditor_Label[3],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[3],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[3],"left",false)
 
GUIEditor_Label[4] = guiCreateLabel(1,73,70,16,"-English Only",true,GUIEditor_Label[1])
guiLabelSetColor(GUIEditor_Label[4],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[4],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[4],"left",false)
 
GUIEditor_TabPanel[1] = guiCreateTabPanel(5,115,495,225,true,GUIEditor_Label[1])
 
GUIEditor_Tab[1] = guiCreateTab("Exceptions",GUIEditor_TabPanel[1])
 
GUIEditor_Label[5] = guiCreateLabel(10,13,469,177,"Exeptions:",true,GUIEditor_Tab[1])
guiLabelSetColor(GUIEditor_Label[5],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[5],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[5],"left",false)
 
GUIEditor_Label[6] = guiCreateLabel(1,22,267,19,"-You can talk other language if You are in -GTD-",true,GUIEditor_Label[5])
guiLabelSetColor(GUIEditor_Label[6],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[6],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[6],"left",false)
 
GUIEditor_Tab[2] = guiCreateTab("-GTD-Members",GUIEditor_TabPanel[1])
 
GUIEditor_Label[7] = guiCreateLabel(18,16,118,18,"Leaders:",true,GUIEditor_Tab[2])
guiLabelSetColor(GUIEditor_Label[7],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[7],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[7],"left",false)
 
GUIEditor_Label[8] = guiCreateLabel(69,17,77,17,"Bleidex",true,GUIEditor_Tab[2])
guiLabelSetColor(GUIEditor_Label[8],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[8],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[8],"left",false)
 
GUIEditor_Label[9] = guiCreateLabel(16,43,455,20,"Co-Leaders: -",true,GUIEditor_Tab[2])
guiLabelSetColor(GUIEditor_Label[9],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[9],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[9],"left",false)
 
GUIEditor_Label[10] = guiCreateLabel(18,73,444,20,"Full Members: -",true,GUIEditor_Tab[2])
guiLabelSetColor(GUIEditor_Label[10],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[10],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[10],"left",false)
 
GUIEditor_Label[11] = guiCreateLabel(17,107,462,22,"Trial members: Anna    Denon",true,GUIEditor_Tab[2])
guiLabelSetColor(GUIEditor_Label[11],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[11],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[11],"left",false)
 
GUIEditor_Label[12] = guiCreateLabel(149,23,326,80,"www.gtd.wu.lt",true,GUIEditor_Label[1])
guiLabelSetColor(GUIEditor_Label[12],0,50,255)
guiLabelSetVerticalAlign(GUIEditor_Label[12],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[12],"left",false)
guiSetFont(GUIEditor_Label[12],"sa-header")
 
   addEventHandler( "onClientGUIClick", Cancel, CloseLoginWindow, false )
 
openLoginWindow()
 
end
 
function openRulesWindow()
 
guiSetVisible( GUIEditor_Window[1], true )
   showCursor( true )
 
end
 
function closeRulesWindow()
 
   guiSetVisible( GUIEditor_Window[1], false )
   showCursor( false )
 
end
 
addEventHandler("onClientResourceStart",getResourceRootElement(),CreateRulesWindow)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...