TheSmart Posted August 2, 2015 Posted August 2, 2015 hey guys! today i was making a login panel but it have some problem it when i click on login button it have to show dxlogin and loggingMenu but loggingMenu won't showing here is code loggingMenu function loggingMenu () loginuseredit = guiCreateEdit(181, 584, 156, 25, "Username....", false) loginpassedit = guiCreateEdit(181, 654, 156, 25, "Password", false) guiEditSetMasked(loginpassedit, true) playbtn = guiCreateButton(150, 704, 177, 50, "Play", false) guiSetAlpha(playbtn, 0.00) end dxlogin function dxlogin () dxDrawLine(123 - 1, 540 - 1, 123 - 1, 771, tocolor(252, 252, 252, 255), 1, false) dxDrawLine(364, 540 - 1, 123 - 1, 540 - 1, tocolor(252, 252, 252, 255), 1, false) dxDrawLine(123 - 1, 771, 364, 771, tocolor(252, 252, 252, 255), 1, false) dxDrawLine(364, 771, 364, 540 - 1, tocolor(252, 252, 252, 255), 1, false) dxDrawRectangle(123, 540, 241, 231, tocolor(0, 0, 0, 229), false) dxDrawText("Username:-", 129, 557, 221, 584, tocolor(255, 255, 255, 255), 0.50, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Password:-", 129, 623, 221, 650, tocolor(255, 255, 255, 255), 0.50, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Play", 151, 702, 327, 754, tocolor(255, 255, 255, 255), 2.00, "bankgothic", "left", "top", false, false, false, false, false) end and here is it button click function function logginbtn(button,state) if (button == "left" and state == "up") then if (source == loginbtn) then addEventHandler("onResourceStart", resourceRoot, loggingMenu) addEventHandler("onClientRender", root, dxlogin) end end end addEventHandler("onClientGUIClick", getRootElement(), logginbtn) no error in Debugscript 3 D:, what wrong doing i'm?
KariiiM Posted August 2, 2015 Posted August 2, 2015 (edited) Try this function loggingMenu () loginuseredit = guiCreateEdit(181, 584, 156, 25, "Username....", true) loginpassedit = guiCreateEdit(181, 654, 156, 25, "Password", true) guiEditSetMasked(loginpassedit, true) playbtn = guiCreateButton(150, 704, 177, 50, "Play", false) guiSetAlpha(playbtn, 0.00) end Edited August 2, 2015 by Guest
iMr.Dawix~# Posted August 2, 2015 Posted August 2, 2015 function logginbtn(button,state) if (button == "left" and state == "up") then if (source == loginbtn) then addEventHandler("onResourceStart", resourceRoot, loggingMenu) addEventHandler("onClientRender", root, dxlogin) end end end addEventHandler("onClientGUIClick", getRootElement(), logginbtn) what you want from line 4 , "onResourceStart" just for server side
TheSmart Posted August 2, 2015 Author Posted August 2, 2015 (edited) function logginbtn(button,state) if (button == "left" and state == "up") then if (source == loginbtn) then addEventHandler("onResourceStart", resourceRoot, loggingMenu) addEventHandler("onClientRender", root, dxlogin) end end end addEventHandler("onClientGUIClick", getRootElement(), logginbtn) what you want from line 4 , "onResourceStart" just for server side opps i change it into "onClientResourceStart" but still doesn't work EDIT : i got that error http://prntscr.com/7zvvma Edited August 2, 2015 by Guest
KariiiM Posted August 2, 2015 Posted August 2, 2015 Try this function loggingMenu () loginuseredit = guiCreateEdit(181, 584, 156, 25, "Username....", true) loginpassedit = guiCreateEdit(181, 654, 156, 25, "Password", true) guiEditSetMasked(loginpassedit, true) playbtn = guiCreateButton(150, 704, 177, 50, "Play", false) guiSetAlpha(playbtn, 0.00) end You tried that? If is your problem the edit box doesn't showing so this must works
TheSmart Posted August 2, 2015 Author Posted August 2, 2015 Try this function loggingMenu () loginuseredit = guiCreateEdit(181, 584, 156, 25, "Username....", true) loginpassedit = guiCreateEdit(181, 654, 156, 25, "Password", true) guiEditSetMasked(loginpassedit, true) playbtn = guiCreateButton(150, 704, 177, 50, "Play", false) guiSetAlpha(playbtn, 0.00) end You tried that? If is your problem the edit box doesn't showing so this must works yes i did but still not working
iMr.Dawix~# Posted August 2, 2015 Posted August 2, 2015 opps i change it into "onClientResourceStart" but still doesn't work EDIT : i got that error http://prntscr.com/7zvvma the event is already added .. try this one function logginbtn(button,state) if (button == "left" and state == "up") then if (source == loginbtn) then addEventHandler("onClientRender", root, dxlogin) end end end addEventHandler("onClientGUIClick", getRootElement(), logginbtn)
TheSmart Posted August 2, 2015 Author Posted August 2, 2015 (edited) ok but what about loggingMenu? how i can show it? forgive that Edited August 2, 2015 by Guest
iMr.Dawix~# Posted August 2, 2015 Posted August 2, 2015 ok but what about loggingMenu? how i can show it?btw that event is handler at here function openBtns () newsbtn = guiCreateButton(743, 510, 88, 26, "News", false) guiSetAlpha(newsbtn, 0.00) registermbtn = guiCreateButton(416, 509, 161, 30, "Register", false) guiSetAlpha(registermbtn, 0.00) staffbtn = guiCreateButton(1001, 509, 104, 30, "Staff", false) guiSetAlpha(staffbtn, 0.00) loginbtn = guiCreateButton(183, 509, 111, 30, "login", false) guiSetAlpha(loginbtn, 0.00) end addEventHandler ( "onClientResourceStart", getRootElement(), openBtns) function openBtns () newsbtn = guiCreateButton(743, 510, 88, 26, "News", false) guiSetAlpha(newsbtn, 0.00) registermbtn = guiCreateButton(416, 509, 161, 30, "Register", false) guiSetAlpha(registermbtn, 0.00) staffbtn = guiCreateButton(1001, 509, 104, 30, "Staff", false) guiSetAlpha(staffbtn, 0.00) loginbtn = guiCreateButton(183, 509, 111, 30, "login", false) guiSetAlpha(loginbtn, 0.00) end addEventHandler("onClientResourceStart",resourceRoot,openBtns) about login panel .. show me full code maybe login dx is behind register dx or something like that
GTX Posted August 2, 2015 Posted August 2, 2015 I read it more well than you. Do you want to show the buttons or no? Because I understood you so. Or your English sucks.
TheSmart Posted August 2, 2015 Author Posted August 2, 2015 check my first post that what i want and you need some rest
GTX Posted August 2, 2015 Posted August 2, 2015 function logginbtn(button,state) if (button == "left" and state == "up") then if (source == loginbtn) then loggingMenu() addEventHandler("onClientRender", root, dxlogin) end end end addEventHandler("onClientGUIClick", getRootElement(), logginbtn) This?
TheSmart Posted August 2, 2015 Author Posted August 2, 2015 ye but still won't showing loggingMenu http://prntscr.com/7zygwf
TheSmart Posted August 2, 2015 Author Posted August 2, 2015 (edited) SLOVED. Edited August 2, 2015 by Guest
GTX Posted August 2, 2015 Posted August 2, 2015 You've set relative argument to true, while your positions are absolute. guiCreateEdit(..., "Username...", false)
TheSmart Posted August 2, 2015 Author Posted August 2, 2015 thnx it work kariim tell me to set it true
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