el_motoblock Posted March 7, 2012 Share Posted March 7, 2012 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
Kenix Posted March 7, 2012 Share Posted March 7, 2012 LogRegGetNN = guiCreateButton(0.8513,0.1615,0.1152,0.1458,"get",true,LogRegWin) Возвращает элемент гуи-лейбл. if LogRegGetNN == "left" then Это условие не будет выполняться.( Строка 24 ) Зачем делать всё в 2 событиях? В чём смысл? Link to comment
el_motoblock Posted March 7, 2012 Author Share Posted March 7, 2012 кнопок то несколько будет. на кнопку гет будет в строку логина вводится имя, но это не обязаловка вот гуи Link to comment
Kenix Posted March 7, 2012 Share Posted March 7, 2012 Непонял тебя. Я тебе указал ошибку. И ещё при старте любого ресурса у тебя будет появляться окно. Link to comment
Lex128 Posted March 7, 2012 Share Posted March 7, 2012 В твоей отдельной теме viewtopic.php?f=142&t=41033 лови ответ) 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