TheSmart Posted June 21, 2015 Posted June 21, 2015 hey guys ! today i'm trying to make information panel but it's not working idk why can anybody fix it? --[[ Author : TheSm@rt Description : Help panel for servers ====== Help Panel ====== ]]-- addEventHandler("onClientRender", root, function() helpwindow = dxDrawRectangle(30, 65, 1067, 752, tocolor(6, 7, 6, 212), false) dxDrawText("Help Panel", 60, 76, 650, 174, tocolor(255, 255, 255, 255), 3.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawLine(30, 207, 1096, 207, tocolor(255, 255, 255, 255), 2, false) dxDrawLine(30, 211, 1095, 211, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(30, 66, 1095, 66, tocolor(255, 255, 255, 255), 3, false) dxDrawLine(32, 817, 1097, 817, tocolor(255, 255, 255, 255), 3, false) dxDrawLine(1095, 66, 1095, 818, tocolor(255, 255, 255, 255), 3, false) dxDrawLine(30, 66, 30, 818, tocolor(255, 255, 255, 255), 3, false) end ) addEventHandler("onClientResourceStart", resourceRoot, function() Rules = guiCreateButton(34, 246, 214, 43, "Rules", false, helpwindow) guiSetAlpha(Rules, 0.52) guiSetFont(Rules, font0_PetitFormalScript) Command = guiCreateButton(34, 324, 214, 43, "Command", false, helpwindow) guiSetAlpha(Command, 0.52) guiSetFont(Command, font0_PetitFormalScript) Staff = guiCreateButton(34, 400, 214, 43, "Staff Member", false, helpwindow) guiSetAlpha(Staff, 0.52) guiSetFont(Staff, font1_PetitFormalScript) About = guiCreateButton(34, 476, 214, 43, "About Us", false, helpwindow) guiSetAlpha(About, 0.52) guiSetFont(About, font0_PetitFormalScript) Jobs = guiCreateButton(34, 546, 214, 43, "Jobs", false, helpwindow) guiSetAlpha(Jobs, 0.52) guiSetFont(Jobs, font0_PetitFormalScript) News = guiCreateButton(34, 621, 214, 43, "News", false, helpwindow) guiSetAlpha(News, 0.52) guiSetFont(News, font0_PetitFormalScript) helpmemo = guiCreateMemo(274, 251, 789, 538, "", false, helpwindow) guiMemoSetReadOnly(helpmemo, true) end ) function open() if (guiGetVisible (helpwindow) == false) then guiSetVisible(helpwindow, true) showCursor(true) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(helpwindow,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(helpwindow,x,y,false) centerWindow(helpwindow) elseif (guiGetVisible (helpwindow) == true) then guiSetVisible(helpwindow, false) showCursor(false) end end bindKey ("F1", "down", open) function rules () rulestxt = fileOpen("Rules.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", Rules, rules) function commands () rulestxt = fileOpen("Commands.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", Command, commands) function about () rulestxt = fileOpen("About.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", About, about) function staff () rulestxt = fileOpen("Staff.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", Staff, staff) function jobs () rulestxt = fileOpen("Jobs.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", Jobs, jobs) function news () rulestxt = fileOpen("News.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", News, news)
Dealman Posted June 21, 2015 Posted June 21, 2015 DX Drawings don't return any element. You'll have to use addEventHandler and removeEventHandler or if statements to decide when to draw the window.
TheSmart Posted June 21, 2015 Author Posted June 21, 2015 Well don't know how to do it, can you do it? because i'm still new at Scripting.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now