Jump to content

Client getPlayerName чёта не гетает


Recommended Posts

addEventHandler( "onClientResourceStart", getRootElement( ),     
    function() 
        LogRegWin = guiCreateWindow(0.3487,0.2783,0.3363,0.32,"Login/Register",true) 
        guiSetAlpha(LogRegWin,1) 
        guiWindowSetMovable(LogRegWin,false) 
        guiWindowSetSizable(LogRegWin,false) 
        LogRegLoginEdit = guiCreateEdit(0.2602,0.1667,0.5836,0.1406,"Login",true,LogRegWin) 
        LogRegLoginText = guiCreateLabel(0.0335,0.1927,0.2045,0.1146,"Nickname",true,LogRegWin) 
        guiLabelSetColor(LogRegLoginText,76,255,0) 
        LogRegPassEdit = guiCreateEdit(0.2602,0.3958,0.7063,0.1406,"Password here",true,LogRegWin) 
        LogRegPassText = guiCreateLabel(0.0335,0.4219,0.2045,0.1146,"Password",true,LogRegWin) 
        guiLabelSetColor(LogRegPassText,255,0,0) 
        LogRegLogBtn = guiCreateButton(0.0558,0.6198,0.3941,0.2865,"Login",true,LogRegWin) 
        guiSetFont(LogRegLogBtn,"sa-header") 
        LogRegRegBtn = guiCreateButton(0.5651,0.6198,0.3792,0.2865,"Reg.",true,LogRegWin) 
        guiSetFont(LogRegRegBtn,"sa-header") 
        LogRegGetNN = guiCreateButton(0.8513,0.1615,0.1152,0.1458,"get",true,LogRegWin) 
        showCursor ( true ) 
    end 
) 
  
addEventHandler( "onClientResourceStart", getRootElement( ), 
function (button) 
    if LogRegGetNN == "left" then 
        local localPlayerName = getPlayerName(getLocalPlayer()) 
        guiSetText ( LogRegLoginEdit, localPlayerName ) 
    end 
end 
) 
  
  
  
  
  
  

Link to comment
LogRegGetNN = guiCreateButton(0.8513,0.1615,0.1152,0.1458,"get",true,LogRegWin) 

Возвращает элемент гуи-лейбл.

if LogRegGetNN == "left" then 

Это условие не будет выполняться.( Строка 24 )

Зачем делать всё в 2 событиях?

В чём смысл?

Link to comment

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