Jump to content

dxLogin


TheSmart

Recommended Posts

Posted

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 :o 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?

RNV7NVT.png

Posted (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 by Guest
Posted
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

My E-mails:

" Manners Maketh Man "

" الأخلاق تصنع الرجل "

░░░░░███████ ]▄▄▄▄▄▄▄▄ BooM !

▂▄▅█████████▅▄▃▂

███████████████████].

◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤

Posted (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 :P i change it into "onClientResourceStart" but still doesn't work

EDIT : i got that error http://prntscr.com/7zvvma

Edited by Guest
Posted
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

Posted
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

Posted

opps :P 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) 

My E-mails:

" Manners Maketh Man "

" الأخلاق تصنع الرجل "

░░░░░███████ ]▄▄▄▄▄▄▄▄ BooM !

▂▄▅█████████▅▄▃▂

███████████████████].

◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤

Posted
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) 

:D

about login panel .. show me full code

maybe login dx is behind register dx or something like that

My E-mails:

" Manners Maketh Man "

" الأخلاق تصنع الرجل "

░░░░░███████ ]▄▄▄▄▄▄▄▄ BooM !

▂▄▅█████████▅▄▃▂

███████████████████].

◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤

Posted
guiSetAlpha(newsbtn, 1) -- Etc. 

Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS.

Developer and owner of

https://projectbea.st - Project Beast
Posted

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.

Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS.

Developer and owner of

https://projectbea.st - Project Beast
Posted
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?

Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS.

Developer and owner of

https://projectbea.st - Project Beast
Posted

Are you sure? Maybe it's under the rectangle.

Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS.

Developer and owner of

https://projectbea.st - Project Beast
Posted

You've set relative argument to true, while your positions are absolute.

guiCreateEdit(..., "Username...", false) 

Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS.

Developer and owner of

https://projectbea.st - Project Beast

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