MoeezKhan Posted February 16, 2014 Share Posted February 16, 2014 Hi all i make help panel but it not working anybody where is problem hope you tell me --client-- --[[ Author : Moeez Description : Information Panel For Servers ----- Information Panel ----- ]]--- helpwindow = guiCreateWindow(141, 81, 535, 503, "SAM:RPG Information Panel", false) guiWindowSetSizable(helpwindow, false) helpmemo = guiCreateMemo(9, 17, 516, 302, "write some text here", false, GUIEditor.window[1]) guiMemoSetReadOnly(helpmemo, true) commandbtn = guiCreateButton(9, 319, 105, 53, "Command", false, helpwindow) guiSetProperty(commandbtn, "NormalTextColour", "FFAAAAAA") GUIEditor.memo[2] = guiCreateMemo(-98, -338, 340, 20, "", false, GUIEditor.button[1]) GUIEditor.button[2] = guiCreateButton(228, -273, 15, 15, "", false, GUIEditor.button[1]) GUIEditor.memo[3] = guiCreateMemo(513, 166, 20, 20, "", false, GUIEditor.button[1]) staffbtn = guiCreateButton(9, 371, 105, 57, "Staff", false, helpwindow]) guiSetProperty(staffbtnsbtn, "NormalTextColour", "FFAAAAAA") eventbtn = guiCreateButton(10, 429, 104, 55, "Event", false, helpwindow) guiSetProperty(eventbtn, "NormalTextColour", "FFAAAAAA") infbtn = guiCreateButton(114, 318, 130, 54, "Information", false, helpwindow) guiSetProperty(infbtn, "NormalTextColour", "FFAAAAAA") rulesbtn = guiCreateButton(244, 319, 125, 53, "Rules", false, helpwindow) guiSetProperty(rulesbtn, "NormalTextColour", "FFAAAAAA") upgradebtn = guiCreateButton(369, 320, 151, 52, "Upgrade", false, helpwindow) guiSetProperty(upgradebtn, "NormalTextColour", "FFAAAAAA") samrpgbtn = guiCreateButton(115, 371, 410, 116, "SAM:RPG", false, helpwindow) guiSetProperty(commandsbtn, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientRender", root, function() dxDrawText("San Andreas Magical: RPG", 144, 36, 672, 81, tocolor(255, 255, 255, 255), 2.00, "pricedown", "left", "top", false, false, true, false, false) 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 Command () rulestxt = fileOpen("Command.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", commandbtn, command) function staff () rulestxt = fileOpen("Staff.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", staffbtn, staff) function Event () rulestxt = fileOpen("Event.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", eventbtn, Event) function Information () rulestxt = fileOpen("Information.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", infbtn, Information) function Rules () rulestxt = fileOpen("Rules.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", rulesbtn, Rules) function Upgrade () rulestxt = fileOpen("Upgrade.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", upgradebtn, Upgrade) function SAM:RPG () rulestxt = fileOpen("SAMRPG.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", samrpgbtn, SAM:RPG) Link to comment
Moderators Citizen Posted February 16, 2014 Moderators Share Posted February 16, 2014 If you want fast help, give us all informations we need. Here I would like the client errors if there are any. You can see them by hitting /debugscript 3 if you are logged in as admin. Link to comment
MoeezKhan Posted February 16, 2014 Author Share Posted February 16, 2014 here is error ERROR: Loading script failed:m-lock/Information.lua:17:')'expected (to close '('at line 16) near "GUIEditor" Link to comment
Castillo Posted February 16, 2014 Share Posted February 16, 2014 --[[ Author : Moeez Description : Information Panel For Servers ----- Information Panel ----- ]]--- helpwindow = guiCreateWindow(141, 81, 535, 503, "SAM:RPG Information Panel", false) guiWindowSetSizable(helpwindow, false) helpmemo = guiCreateMemo(9, 17, 516, 302, "write some text here", false, GUIEditor.window[1]) guiMemoSetReadOnly(helpmemo, true) commandbtn = guiCreateButton(9, 319, 105, 53, "Command", false, helpwindow) guiSetProperty(commandbtn, "NormalTextColour", "FFAAAAAA") GUIEditor.memo[2] = guiCreateMemo(-98, -338, 340, 20, "", false, GUIEditor.button[1]) GUIEditor.button[2] = guiCreateButton(228, -273, 15, 15, "", false, GUIEditor.button[1]) GUIEditor.memo[3] = guiCreateMemo(513, 166, 20, 20, "", false, GUIEditor.button[1]) staffbtn = guiCreateButton(9, 371, 105, 57, "Staff", false, helpwindow) guiSetProperty(staffbtnsbtn, "NormalTextColour", "FFAAAAAA") eventbtn = guiCreateButton(10, 429, 104, 55, "Event", false, helpwindow) guiSetProperty(eventbtn, "NormalTextColour", "FFAAAAAA") infbtn = guiCreateButton(114, 318, 130, 54, "Information", false, helpwindow) guiSetProperty(infbtn, "NormalTextColour", "FFAAAAAA") rulesbtn = guiCreateButton(244, 319, 125, 53, "Rules", false, helpwindow) guiSetProperty(rulesbtn, "NormalTextColour", "FFAAAAAA") upgradebtn = guiCreateButton(369, 320, 151, 52, "Upgrade", false, helpwindow) guiSetProperty(upgradebtn, "NormalTextColour", "FFAAAAAA") samrpgbtn = guiCreateButton(115, 371, 410, 116, "SAM:RPG", false, helpwindow) guiSetProperty(commandsbtn, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientRender", root, function() dxDrawText("San Andreas Magical: RPG", 144, 36, 672, 81, tocolor(255, 255, 255, 255), 2.00, "pricedown", "left", "top", false, false, true, false, false) 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 Command () rulestxt = fileOpen("Command.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", commandbtn, command) function staff () rulestxt = fileOpen("Staff.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", staffbtn, staff) function Event () rulestxt = fileOpen("Event.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", eventbtn, Event) function Information () rulestxt = fileOpen("Information.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", infbtn, Information) function Rules () rulestxt = fileOpen("Rules.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", rulesbtn, Rules) function Upgrade () rulestxt = fileOpen("Upgrade.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", upgradebtn, Upgrade) function SAM_RPG () rulestxt = fileOpen("SAMRPG.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", samrpgbtn, SAM_RPG) Link to comment
MoeezKhan Posted February 16, 2014 Author Share Posted February 16, 2014 thanks but when i start script it automatic open and no button and memo appear one error in debugscript 3 ERROR:m-lock\Information.lua:11: attempt in index global 'GUIEditor' (a nil value) Link to comment
Karuzo Posted February 16, 2014 Share Posted February 16, 2014 Change the GUIEditor.window/.memo and so on to a new name without GUIEditor. Link to comment
MoeezKhan Posted February 16, 2014 Author Share Posted February 16, 2014 what you mean i cant understand Link to comment
Karuzo Posted February 16, 2014 Share Posted February 16, 2014 --[[ Author : Moeez Description : Information Panel For Servers ----- Information Panel ----- ]]--- helpwindow = guiCreateWindow(141, 81, 535, 503, "SAM:RPG Information Panel", false) guiWindowSetSizable(helpwindow, false) helpmemo = guiCreateMemo(9, 17, 516, 302, "write some text here", false, helpwindow) guiMemoSetReadOnly(helpmemo, true) commandbtn = guiCreateButton(9, 319, 105, 53, "Command", false, helpwindow) guiSetProperty(commandbtn, "NormalTextColour", "FFAAAAAA") memo = guiCreateMemo(-98, -338, 340, 20, "", false, helpwindow) button = guiCreateButton(228, -273, 15, 15, "", false, helpwindow) memo2= guiCreateMemo(513, 166, 20, 20, "", false, helpwindow) staffbtn = guiCreateButton(9, 371, 105, 57, "Staff", false, helpwindow) guiSetProperty(staffbtnsbtn, "NormalTextColour", "FFAAAAAA") eventbtn = guiCreateButton(10, 429, 104, 55, "Event", false, helpwindow) guiSetProperty(eventbtn, "NormalTextColour", "FFAAAAAA") infbtn = guiCreateButton(114, 318, 130, 54, "Information", false, helpwindow) guiSetProperty(infbtn, "NormalTextColour", "FFAAAAAA") rulesbtn = guiCreateButton(244, 319, 125, 53, "Rules", false, helpwindow) guiSetProperty(rulesbtn, "NormalTextColour", "FFAAAAAA") upgradebtn = guiCreateButton(369, 320, 151, 52, "Upgrade", false, helpwindow) guiSetProperty(upgradebtn, "NormalTextColour", "FFAAAAAA") samrpgbtn = guiCreateButton(115, 371, 410, 116, "SAM:RPG", false, helpwindow) guiSetProperty(commandsbtn, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientRender", root, function() dxDrawText("San Andreas Magical: RPG", 144, 36, 672, 81, tocolor(255, 255, 255, 255), 2.00, "pricedown", "left", "top", false, false, true, false, false) 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 Command () rulestxt = fileOpen("Command.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", commandbtn, command) function staff () rulestxt = fileOpen("Staff.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", staffbtn, staff) function Event () rulestxt = fileOpen("Event.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", eventbtn, Event) function Information () rulestxt = fileOpen("Information.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", infbtn, Information) function Rules () rulestxt = fileOpen("Rules.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", rulesbtn, Rules) function Upgrade () rulestxt = fileOpen("Upgrade.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", upgradebtn, Upgrade) function SAM_RPG () rulestxt = fileOpen("SAMRPG.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", samrpgbtn, SAM_RPG) Link to comment
MoeezKhan Posted February 17, 2014 Author Share Posted February 17, 2014 thanks it working but one more problem when i press button it not show text Link to comment
Karuzo Posted February 17, 2014 Share Posted February 17, 2014 Which button ? And what does dbgscript 3 say ? - Please be more specific. I don't understand why you are using .txt's to set the text of an memo, why won't you just set the text normal ? Link to comment
Moderators Citizen Posted February 17, 2014 Moderators Share Posted February 17, 2014 You need to set getPropagated argument of addEventHandler to false for all onClientGUIClick So: addEventHandler("onClientGUIClick", commandbtn, command) will become: addEventHandler("onClientGUIClick", commandbtn, command, false) Do it for all others. Regards, Citizen Link to comment
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