Cruze Posted March 21, 2015 Share Posted March 21, 2015 (edited) Fixed, thanks! Edited March 22, 2015 by Guest Link to comment
TAPL Posted March 21, 2015 Share Posted March 21, 2015 local cmds1 = fileOpen("content/cmds.txt", true) local jobinfo2 = fileOpen("content/jobinfo.txt", true) local english = fileOpen("languages/english.txt", true) local french = xmlLoadFile("languages/french.xml") --local italian = xmlLoadFile("languages/italian.xml") local georgian = xmlLoadFile("languages/georgian.xml") local turkish = xmlLoadFile("languages/turkish.xml") local dutch = xmlLoadFile("languages/german.xml") local serbian = fileOpen("languages/serbian.txt", true) local spanish = xmlLoadFile("languages/spanish.xml") local filipino = fileOpen("languages/filipino.txt", true) local arabic = xmlLoadFile("languages/arabic.xml") cmds = fileRead(cmds1, 50000) jobInfoIG = fileRead(jobinfo2, 50000) eng = fileRead(english, 50000) fre = xmlNodeGetValue(french) --ita = xmlNodeGetValue(italian) geo = xmlNodeGetValue(georgian) turk = xmlNodeGetValue(turkish) deu = xmlNodeGetValue(dutch) serb = fileRead(serbian, 50000) spa = xmlNodeGetValue(spanish) fil = fileRead(filipino, 50000) arab = xmlNodeGetValue(arabic) --Creating GUI elements... function F1Gui() tabPan = guiCreateTabPanel(52, 247, 931, 477, false) guiSetVisible (tabPan, false) rulesTab = guiCreateTab("Server Rules", tabPan) servMemo = guiCreateMemo(4, 12, 917, 431, eng, false, rulesTab) guiMemoSetReadOnly(servMemo, true) jobInfTab = guiCreateTab("Job Informations", tabPan) jobMemo = guiCreateMemo(4, 12, 917, 431, jobInfoIG, false, jobInfTab) guiMemoSetReadOnly(jobMemo, true) cmdsTab = guiCreateTab("Commands", tabPan) cmdMemo = guiCreateMemo(4, 12, 917, 431, cmds, false, cmdsTab) guiMemoSetReadOnly(cmdMemo, true) staffTab = guiCreateTab("Staff Roster", tabPan) gbFlag = guiCreateStaticImage(747, 156, 24, 15, ":NGChelp/images/gb.png", false) frFlag = guiCreateStaticImage(778, 156, 24, 15, ":NGChelp/images/fr.png", false) itFlag = guiCreateStaticImage(809, 156, 24, 15, ":NGChelp/images/it.png", false) deFlag = guiCreateStaticImage(840, 156, 24, 15, ":NGChelp/images/de.png", false) saFlag = guiCreateStaticImage(871, 156, 24, 15, ":NGChelp/images/sa.png", false) skFlag = guiCreateStaticImage(778, 181, 24, 15, ":NGChelp/images/sk.png", false) phFlag = guiCreateStaticImage(809, 181, 24, 15, ":NGChelp/images/ph.png", false) trFlag = guiCreateStaticImage(747, 181, 24, 15, ":NGChelp/images/tr.png", false) esFlag = guiCreateStaticImage(840, 182, 24, 14, ":NGChelp/images/es.png", false) geFlag = guiCreateStaticImage(871, 181, 24, 15, ":NGChelp/images/ge.png", false) guiSetVisible(gbFlag, false) guiSetVisible(frFlag, false) guiSetVisible(itFlag, false) guiSetVisible(deFlag, false) guiSetVisible(skFlag, false) guiSetVisible(saFlag, false) guiSetVisible(geFlag, false) guiSetVisible(phFlag, false) guiSetVisible(esFlag, false) guiSetVisible(trFlag, false) addEventHandler("onClientGUIClick", gbFlag, translatingEnglish, false) addEventHandler("onClientGUIClick", frFlag, translatingFrench, false) --addEventHandler("onClientGUIClick", itFlag, translatingItalian, false) addEventHandler("onClientGUIClick", esFlag, translatingSpanish, false) addEventHandler("onClientGUIClick", geFlag, translatingGeorgian, false) addEventHandler("onClientGUIClick", trFlag, translatingTurkish, false) addEventHandler("onClientGUIClick", phFlag, translatingFilipino, false) addEventHandler("onClientGUIClick", skFlag, translatingSerbian, false) addEventHandler("onClientGUIClick", saFlag, translatingArabic, false) addEventHandler("onClientGUIClick", deFlag, translatingDutch, false) end addEventHandler("onClientResourceStart", resourceRoot, F1Gui) -- Creating dx elements function F1Draw() dxDrawRectangle(35, 59, 966, 41, tocolor(3, 191, 194, 171), true) dxDrawRectangle(35, 99, 966, 635, tocolor(3, 0, 0, 171), false) dxDrawText("NGC Information Panel", 360, 63, 680, 101, tocolor(0, 0, 0, 255), 1.20, "pricedown", "left", "top", false, false, true, true, false) dxDrawText("NGC Information Panel", 360, 61, 680, 99, tocolor(0, 0, 0, 255), 1.20, "pricedown", "left", "top", false, false, true, true, false) dxDrawText("NGC Information Panel", 358, 63, 678, 101, tocolor(0, 0, 0, 255), 1.20, "pricedown", "left", "top", false, false, true, true, false) dxDrawText("NGC Information Panel", 358, 61, 678, 99, tocolor(0, 0, 0, 255), 1.20, "pricedown", "left", "top", false, false, true, true, false) dxDrawText("NGC Information Panel", 359, 62, 679, 100, tocolor(255, 255, 255, 225), 1.20, "pricedown", "left", "top", false, false, true, true, false) dxDrawText("Click on the flag to get the rules translated", 748, 112, 977, 151, tocolor(0, 0, 0, 255), 0.70, "pricedown", "left", "top", false, true, true, false, false) dxDrawText("Click on the flag to get the rules translated", 748, 110, 977, 149, tocolor(0, 0, 0, 255), 0.70, "pricedown", "left", "top", false, true, true, false, false) dxDrawText("Click on the flag to get the rules translated", 746, 112, 975, 151, tocolor(0, 0, 0, 255), 0.70, "pricedown", "left", "top", false, true, true, false, false) dxDrawText("Click on the flag to get the rules translated", 746, 110, 975, 149, tocolor(0, 0, 0, 255), 0.70, "pricedown", "left", "top", false, true, true, false, false) dxDrawText("Click on the flag to get the rules translated", 747, 111, 976, 150, tocolor(255, 255, 255, 255), 0.70, "pricedown", "left", "top", false, true, true, false, false) dxDrawImage(347, 110, 342, 114, ":NGChelp/images/NGC.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) end function showF1() addEventHandler("onClientRender", getRootElement(), F1Draw) end function removeF1() removeEventHandler("onClientRender", getRootElement(), F1Draw) end -- GUI visibility and binding function F1Panel() if getElementData(localPlayer, "isPlayerLoggedin") then if guiGetVisible(tabPan) then then guiSetVisible(tabPan, false) guiSetVisible(gbFlag, false) guiSetVisible(frFlag, false) guiSetVisible(itFlag, false) guiSetVisible(deFlag, false) guiSetVisible(skFlag, false) guiSetVisible(saFlag, false) guiSetVisible(geFlag, false) guiSetVisible(phFlag, false) guiSetVisible(esFlag, false) guiSetVisible(trFlag, false) showCursor(false) showChat(true) removeF1() else guiSetVisible(tabPan, true) guiSetVisible(gbFlag, true) guiSetVisible(frFlag, true) guiSetVisible(itFlag, true) guiSetVisible(deFlag, true) guiSetVisible(skFlag, true) guiSetVisible(saFlag, true) guiSetVisible(geFlag, true) guiSetVisible(phFlag, true) guiSetVisible(esFlag, true) guiSetVisible(trFlag, true) showCursor(true) showChat(false) showF1() end end end bindKey("F1", "down", F1Panel) function translatingEnglish(gbFlag) if (gbFlag == "left") then guiSetText(servMemo, eng) end end function translatingFrench(frFlag) if (frFlag == "left") then guiSetText(servMemo, fre) end end function translatingArabic(saFlag) if (saFlag == "left") then guiSetText(servMemo, arab) end end function translatingDutch(deFlag) if (deFlag == "left") then guiSetText(servMemo, deu) end end --[[function translatingItalian(itFlag) if (itFlag == "left") then guiSetText(servMemo, ita) end end]]-- function translatingGeorgian(geFlag) if (geFlag == "left") then guiSetText(servMemo, geo) end end function translatingTurkish(trFlag) if (trFlag == "left") then guiSetText(servMemo, turk) end end function translatingSerbian(skFlag) if (skFlag == "left") then guiSetText(servMemo, serb) end end function translatingSpanish(esFlag) if (esFlag == "left") then guiSetText(servMemo, spa) end end function translatingFilipino(phFlag) if (phFlag == "left") then guiSetText(servMemo, fil) end end Link to comment
Cruze Posted March 21, 2015 Author Share Posted March 21, 2015 Now when I press F1 nothing appears. No debug errors. Link to comment
roaddog Posted March 21, 2015 Share Posted March 21, 2015 local cmds1 = fileOpen("content/cmds.txt", true) local jobinfo2 = fileOpen("content/jobinfo.txt", true) local english = fileOpen("languages/english.txt", true) local french = xmlLoadFile("languages/french.xml") --local italian = xmlLoadFile("languages/italian.xml") local georgian = xmlLoadFile("languages/georgian.xml") local turkish = xmlLoadFile("languages/turkish.xml") local dutch = xmlLoadFile("languages/german.xml") local serbian = fileOpen("languages/serbian.txt", true) local spanish = xmlLoadFile("languages/spanish.xml") local filipino = fileOpen("languages/filipino.txt", true) local arabic = xmlLoadFile("languages/arabic.xml") cmds = fileRead(cmds1, 50000) jobInfoIG = fileRead(jobinfo2, 50000) eng = fileRead(english, 50000) fre = xmlNodeGetValue(french) --ita = xmlNodeGetValue(italian) geo = xmlNodeGetValue(georgian) turk = xmlNodeGetValue(turkish) deu = xmlNodeGetValue(dutch) serb = fileRead(serbian, 50000) spa = xmlNodeGetValue(spanish) fil = fileRead(filipino, 50000) arab = xmlNodeGetValue(arabic) --Creating GUI elements... function F1Gui() tabPan = guiCreateTabPanel(52, 247, 931, 477, false) guiSetVisible (tabPan, false) rulesTab = guiCreateTab("Server Rules", tabPan) servMemo = guiCreateMemo(4, 12, 917, 431, eng, false, rulesTab) guiMemoSetReadOnly(servMemo, true) jobInfTab = guiCreateTab("Job Informations", tabPan) jobMemo = guiCreateMemo(4, 12, 917, 431, jobInfoIG, false, jobInfTab) guiMemoSetReadOnly(jobMemo, true) cmdsTab = guiCreateTab("Commands", tabPan) cmdMemo = guiCreateMemo(4, 12, 917, 431, cmds, false, cmdsTab) guiMemoSetReadOnly(cmdMemo, true) staffTab = guiCreateTab("Staff Roster", tabPan) gbFlag = guiCreateStaticImage(747, 156, 24, 15, ":NGChelp/images/gb.png", false) frFlag = guiCreateStaticImage(778, 156, 24, 15, ":NGChelp/images/fr.png", false) itFlag = guiCreateStaticImage(809, 156, 24, 15, ":NGChelp/images/it.png", false) deFlag = guiCreateStaticImage(840, 156, 24, 15, ":NGChelp/images/de.png", false) saFlag = guiCreateStaticImage(871, 156, 24, 15, ":NGChelp/images/sa.png", false) skFlag = guiCreateStaticImage(778, 181, 24, 15, ":NGChelp/images/sk.png", false) phFlag = guiCreateStaticImage(809, 181, 24, 15, ":NGChelp/images/ph.png", false) trFlag = guiCreateStaticImage(747, 181, 24, 15, ":NGChelp/images/tr.png", false) esFlag = guiCreateStaticImage(840, 182, 24, 14, ":NGChelp/images/es.png", false) geFlag = guiCreateStaticImage(871, 181, 24, 15, ":NGChelp/images/ge.png", false) guiSetVisible(gbFlag, false) guiSetVisible(frFlag, false) guiSetVisible(itFlag, false) guiSetVisible(deFlag, false) guiSetVisible(skFlag, false) guiSetVisible(saFlag, false) guiSetVisible(geFlag, false) guiSetVisible(phFlag, false) guiSetVisible(esFlag, false) guiSetVisible(trFlag, false) addEventHandler("onClientGUIClick", gbFlag, translatingEnglish, false) addEventHandler("onClientGUIClick", frFlag, translatingFrench, false) --addEventHandler("onClientGUIClick", itFlag, translatingItalian, false) addEventHandler("onClientGUIClick", esFlag, translatingSpanish, false) addEventHandler("onClientGUIClick", geFlag, translatingGeorgian, false) addEventHandler("onClientGUIClick", trFlag, translatingTurkish, false) addEventHandler("onClientGUIClick", phFlag, translatingFilipino, false) addEventHandler("onClientGUIClick", skFlag, translatingSerbian, false) addEventHandler("onClientGUIClick", saFlag, translatingArabic, false) addEventHandler("onClientGUIClick", deFlag, translatingDutch, false) end addEventHandler("onClientResourceStart", resourceRoot, F1Gui) -- Creating dx elements function F1Draw() dxDrawRectangle(35, 59, 966, 41, tocolor(3, 191, 194, 171), true) dxDrawRectangle(35, 99, 966, 635, tocolor(3, 0, 0, 171), false) dxDrawText("NGC Information Panel", 360, 63, 680, 101, tocolor(0, 0, 0, 255), 1.20, "pricedown", "left", "top", false, false, true, true, false) dxDrawText("NGC Information Panel", 360, 61, 680, 99, tocolor(0, 0, 0, 255), 1.20, "pricedown", "left", "top", false, false, true, true, false) dxDrawText("NGC Information Panel", 358, 63, 678, 101, tocolor(0, 0, 0, 255), 1.20, "pricedown", "left", "top", false, false, true, true, false) dxDrawText("NGC Information Panel", 358, 61, 678, 99, tocolor(0, 0, 0, 255), 1.20, "pricedown", "left", "top", false, false, true, true, false) dxDrawText("NGC Information Panel", 359, 62, 679, 100, tocolor(255, 255, 255, 225), 1.20, "pricedown", "left", "top", false, false, true, true, false) dxDrawText("Click on the flag to get the rules translated", 748, 112, 977, 151, tocolor(0, 0, 0, 255), 0.70, "pricedown", "left", "top", false, true, true, false, false) dxDrawText("Click on the flag to get the rules translated", 748, 110, 977, 149, tocolor(0, 0, 0, 255), 0.70, "pricedown", "left", "top", false, true, true, false, false) dxDrawText("Click on the flag to get the rules translated", 746, 112, 975, 151, tocolor(0, 0, 0, 255), 0.70, "pricedown", "left", "top", false, true, true, false, false) dxDrawText("Click on the flag to get the rules translated", 746, 110, 975, 149, tocolor(0, 0, 0, 255), 0.70, "pricedown", "left", "top", false, true, true, false, false) dxDrawText("Click on the flag to get the rules translated", 747, 111, 976, 150, tocolor(255, 255, 255, 255), 0.70, "pricedown", "left", "top", false, true, true, false, false) dxDrawImage(347, 110, 342, 114, ":NGChelp/images/NGC.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) end function showF1() addEventHandler("onClientRender", getRootElement(), F1Draw) end function removeF1() removeEventHandler("onClientRender", getRootElement(), F1Draw) end -- GUI visibility and binding function F1Panel() if getElementData(localPlayer, "isPlayerLoggedin") then if guiGetVisible(tabPan) then guiSetVisible(tabPan, false) guiSetVisible(gbFlag, false) guiSetVisible(frFlag, false) guiSetVisible(itFlag, false) guiSetVisible(deFlag, false) guiSetVisible(skFlag, false) guiSetVisible(saFlag, false) guiSetVisible(geFlag, false) guiSetVisible(phFlag, false) guiSetVisible(esFlag, false) guiSetVisible(trFlag, false) showCursor(false) showChat(true) removeF1() else guiSetVisible(tabPan, true) guiSetVisible(gbFlag, true) guiSetVisible(frFlag, true) guiSetVisible(itFlag, true) guiSetVisible(deFlag, true) guiSetVisible(skFlag, true) guiSetVisible(saFlag, true) guiSetVisible(geFlag, true) guiSetVisible(phFlag, true) guiSetVisible(esFlag, true) guiSetVisible(trFlag, true) showCursor(true) showChat(false) showF1() end end end bindKey("F1", "down", F1Panel) function translatingEnglish(gbFlag) if (gbFlag == "left") then guiSetText(servMemo, eng) end end function translatingFrench(frFlag) if (frFlag == "left") then guiSetText(servMemo, fre) end end function translatingArabic(saFlag) if (saFlag == "left") then guiSetText(servMemo, arab) end end function translatingDutch(deFlag) if (deFlag == "left") then guiSetText(servMemo, deu) end end --[[function translatingItalian(itFlag) if (itFlag == "left") then guiSetText(servMemo, ita) end end]]-- function translatingGeorgian(geFlag) if (geFlag == "left") then guiSetText(servMemo, geo) end end function translatingTurkish(trFlag) if (trFlag == "left") then guiSetText(servMemo, turk) end end function translatingSerbian(skFlag) if (skFlag == "left") then guiSetText(servMemo, serb) end end function translatingSpanish(esFlag) if (esFlag == "left") then guiSetText(servMemo, spa) end end function translatingFilipino(phFlag) if (phFlag == "left") then guiSetText(servMemo, fil) end end Link to comment
Cruze Posted March 21, 2015 Author Share Posted March 21, 2015 I fixed it, thanks for help guys! Link to comment
TAPL Posted March 22, 2015 Share Posted March 22, 2015 It doesn't work because you don't have the element data. Link to comment
3B00DG4MER Posted March 22, 2015 Share Posted March 22, 2015 It doesn't work because you don't have the element data. cuz probably, this is not his script ..... Link to comment
Cruze Posted March 22, 2015 Author Share Posted March 22, 2015 3B00d, eh. It's my own script, I figured out that the element data was the problem. So instead I used my server export to detect if the player is logged in or nope. If you want more proofs, go ahead and PM me. /requesting a lock. P.S Guys, please remove my code to avoid getting it stolen. 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