Jump to content

[HELP]GUi


xXMADEXx

Recommended Posts

Hey guys, i have this GUI, i added binds so it shouldent show when i start the resource, only when the resource is on and i press 'F4'. But instead, when i start the resource, the GUI will show up (

GUIEditor_Window[1] = guiCreateWindow(234,208,1199,642,"US-RP Donation Panel",false) 

but nothing else will. Not even the stuff that is on the GUI and the binds will not work.

Basicly when i start the GUI, the menu will show and i cant get it off my screen. Please help.

-- the GUI 
  
GUIEditor_Window[1] = guiCreateWindow(234,208,1199,642,"US-RP Donation Panel",false) 
guiSetVisible(GUIEditor_Window[1], false) 
guiWindowSetMovable(GUIEditor_Window[1],false) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
GUIEditor_Button[1] = guiCreateButton(9,568,318,65,"Buy Points",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(876,568,314,65,"Exit",false,GUIEditor_Window[1]) 
GUIEditor_Memo[1] = guiCreateMemo(333,571,542,62,"\n                                 More Information On Forums ([url=http://us-rp.site90.net]http://us-rp.site90.net[/url])",false,GUIEditor_Window[1]) 
GUIEditor_TabPanel[1] = guiCreateTabPanel(9,22,1181,546,false,GUIEditor_Window[1]) 
GUIEditor_Tab[1] = guiCreateTab("Bronze",GUIEditor_TabPanel[1]) 
GUIEditor_Grid[1] = guiCreateGridList(1171,14,5,5,false,GUIEditor_Tab[1]) 
guiGridListSetSelectionMode(GUIEditor_Grid[1],2) 
GUIEditor_Grid[2] = guiCreateGridList(910,7,271,514,false,GUIEditor_Tab[1]) 
guiGridListSetSelectionMode(GUIEditor_Grid[2],2) 
  
guiGridListAddColumn(GUIEditor_Grid[2],"What You Will Unlock:",0.2) 
  
for i = 1, 1 do 
    guiGridListAddRow(GUIEditor_Grid[2]) 
end 
  
guiGridListSetItemText(GUIEditor_Grid[2],0,1,"") 
GUIEditor_Grid[3] = guiCreateGridList(910,7,271,514,false,GUIEditor_Tab[1]) 
guiGridListSetSelectionMode(GUIEditor_Grid[3],2) 
GUIEditor_Tab[2] = guiCreateTab("Silver",GUIEditor_TabPanel[1]) 
GUIEditor_Tab[3] = guiCreateTab("Gold",GUIEditor_TabPanel[1]) 
GUIEditor_Tab[4] = guiCreateTab("Diamond",GUIEditor_TabPanel[1]) 
  
GUIEditor_Window[2] = guiCreateWindow(234,208,1199,642,"US-RP Donation Panel",false) 
guiSetVisible(GUIEditor_Window[2], false) 
guiWindowSetMovable(GUIEditor_Window[2],false) 
guiWindowSetSizable(GUIEditor_Window[2],false) 
GUIEditor_Button[3] = guiCreateButton(9,568,318,65,"Buy Points",false,GUIEditor_Window[2]) 
exitbtn = guiCreateButton(876,568,314,65,"Exit",false,GUIEditor_Window[2]) 
GUIEditor_Memo[2] = guiCreateMemo(333,571,542,62,"\n                           More Information On Are Forums! ([url=http://us-rp.site90.net]http://us-rp.site90.net[/url])",false,GUIEditor_Window[2]) 
local screenX, screenY = guiGetScreenSize() 
local width, height = 200, 200 
local x = (screenX/2) - (width/2) 
local y = (screenY/2) - (height/2) 
local lp = getLocalPlayer() 
  
GUIEditor_Window[3] = guiCreateWindow(234,208,1199,642,"US-RP Donation Panel",false) 
guiWindowSetMovable(GUIEditor_Window[3],false) 
guiWindowSetSizable(GUIEditor_Window[3],false) 
GUIEditor_Button[5] = guiCreateButton(9,568,318,65,"Buy Points",false,GUIEditor_Window[3]) 
GUIEditor_Button[6] = guiCreateButton(876,568,314,65,"Exit",false,GUIEditor_Window[3]) 
GUIEditor_Memo[3] = guiCreateMemo(333,571,542,62,"\n                                 More Information On Forums ([url=http://us-rp.site90.net]http://us-rp.site90.net[/url])",false,GUIEditor_Window[3]) 
GUIEditor_TabPanel[2] = guiCreateTabPanel(9,22,1181,546,false,GUIEditor_Window[3]) 
GUIEditor_Tab[5] = guiCreateTab("Bronze",GUIEditor_TabPanel[2]) 
GUIEditor_Grid[4] = guiCreateGridList(1171,14,5,5,false,GUIEditor_Tab[5]) 
guiGridListSetSelectionMode(GUIEditor_Grid[4],2) 
GUIEditor_Label[1] = guiCreateLabel(2,2,1178,518,"\n\nBronze is the lowest level of donation. You will unlock a Laser, and the Donation base.\n\nYou can read more about donation levels on are forums. If you really like US-RP, you will donate.",false,GUIEditor_Tab[5]) 
guiLabelSetHorizontalAlign(GUIEditor_Label[1],"center",false) 
GUIEditor_Tab[6] = guiCreateTab("Silver",GUIEditor_TabPanel[2]) 
GUIEditor_Label[2] = guiCreateLabel(0,0,1180,518,"\n\nSilver is a decent donation level. Its pretty cheap, and the rewards are worth it.\n\nYou will unlock a Laser, Donation base, and a vehicle spawner.\n\nThe vehicle spawner will have a Huntley, and a Landstalker! You will also unlock the donation\n\ncommand that is kind of like the military command.\n\nIt will give you a skin and put you on the Donation team.",false,GUIEditor_Tab[6]) 
guiLabelSetHorizontalAlign(GUIEditor_Label[2],"center",false) 
GUIEditor_Tab[7] = guiCreateTab("Gold",GUIEditor_TabPanel[2]) 
GUIEditor_Label[3] = guiCreateLabel(0,0,1181,521,"\n\nIn the Gold donation section, you will unlock everything from the Silver donation level,\n\nbut the spawner will also have an Infernus, and Kart.\n\nYou will also unlock 'Instant Staff.' Instant staff is where a\n\nstaff member of US-RP will report to you and help you with your problems. And, you will even get a weapon spawner.\n\n The weapon spawner will be equiped with an M4, Combat Shotgun, and Deagle.",false,GUIEditor_Tab[7]) 
guiLabelSetHorizontalAlign(GUIEditor_Label[3],"center",false) 
GUIEditor_Tab[8] = guiCreateTab("Diamond",GUIEditor_TabPanel[2]) 
GUIEditor_Label[4] = guiCreateLabel(0,2,1181,517,"\n\nIn the Diamond donation, you will unlock everything. You will unlock everything from Bronze, Silver, and Gold donation groups.\n\nYou will also get some stuff added. You will get Instant Staff Level 2.\n\nInstant Staff Level 2 is where staff will come to you, give you a car (the car must be in yoru vehicle spawner)\n\nand will also help you out with the server. You will also get Vehicle Spawner level 2, Weapon Spawner Level 2, and even a plane spawner.\n\nIn Car Spawner Level 2, you will get all the cars from Gold Donation, and a Super GT, and bullet. In Weapon Spawner Level 2, you will get all weapons from Gold Donation + Chainsaw, and a Rifle,\n\nDiamond donations help out US-RP big time!",false,GUIEditor_Tab[8]) 
guiLabelSetHorizontalAlign(GUIEditor_Label[4],"center",false) 
  
--functions 
  
function resourceStart () 
  bindKey ("F4", "down", menuShow) 
end 
addEventHandler ("onClientResourceStart", getResourceRootElement ( getThisResource () ), resourceStart) 
  
function menuShow () 
    visableornot = guiGetVisible (gUIEditor_Window[1]) 
    if (visableornot == true) then 
        guiSetVisible (GUIEditor_Window[1], false) 
        showCursor (false) 
    end 
    if (visableornot == false) then 
        guiSetVisible (GUIEditor_Window[1], true) 
        showCursor (true) 
    end 
end 
  
function resourceStart () 
  bindKey ("F4", "down", menuShow2) 
end 
addEventHandler ("onClientResourceStart", getResourceRootElement ( getThisResource () ), resourceStart) 
  
function menuShow2 () 
    visableornot = guiGetVisible (gUIEditor_Window[2]) 
    if (visableornot == true) then 
        guiSetVisible (GUIEditor_Window[2], false) 
        showCursor (false) 
    end 
    if (visableornot == false) then 
        guiSetVisible (GUIEditor_Window[2], true) 
        showCursor (true) 
    end 
end 
  

Link to comment

Use /debugscript command and you will find out why. You will get an error on line 73 and 92.

Lua is case-sensitive language. gUIEditor_Window is not the same as GUIEditor_Window.

Learn how to debug your scripts. Every single scripter/programmer debug their code.

Link to comment
Use /debugscript command and you will find out why. You will get an error on line 73 and 92.

Lua is case-sensitive language. gUIEditor_Window is not the same as GUIEditor_Window.

Learn how to debug your scripts. Every single scripter/programmer debug their code.

Thank you, i had no idea about that command :)

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...