Hi MTA. i dicided to star in the scripting mta world,im a really noob so i just started reading the tutorials on the wiki and i made my fisrt custom Gui login window but it just dont appears when i started the resource.
heres my gui.lua file
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()),
function()
loginpanel = guiCreateWindow(233, 65, 561, 618, "Ventana de Inicio", false)
guiWindowSetSizable(loginpanel, false)
guiSetAlpha(loginpanel, 0.65)
logbutton = guiCreateButton(21, 501, 200, 42, "Iniciar Sesión", false, loginpanel )
guiSetFont(logbutton, "sa-header")
guiSetProperty(logbutton, "NormalTextColour", "FF69D429")
regbutton = guiCreateButton(21, 553, 166, 42, "Registrarse", false, loginpanel)
guiSetFont(regbutton, "sa-header")
guiSetProperty(regbutton, "NormalTextColour", "FF69D429")
guestbutton = guiCreateButton(199, 553, 129, 42, "Anónimo", false, loginpanel)
guiSetFont(guestbutton, "sa-header")
reguserlabel = guiCreateLabel(31, 353, 59, 17, "USUARIO:", false, loginpanel)
guiLabelSetColor(reguserlabel, 252, 0, 0)
regpasslabel = guiCreateLabel(31, 427, 86, 17, "CONTRASEÑA:", false, loginpanel)
guiLabelSetColor(regpasslabel, 252, 0, 0)
userreglogbox = guiCreateEdit(21, 380, 188, 37, "", false, loginpanel)
passreglogbox = guiCreateEdit(21, 454, 188, 37, "", false, loginpanel)
memo = guiCreateMemo(21, 32, 517, 217, "", false, loginpanel)
memo2 = guiCreateMemo(21, 262, 205, 81, "", false, loginpanel)
guiEditSetMasked(passreglogbox, true)
showCursor (true)
guiSetInputEnabled(true)
)
and my meta.xml
> author="elmy2424" version="1.0.0" type="script" name="Skin Selector" description="" showInResourceBrowser="true" /> ="gui.lua" type="client" />>
whats wrong?????
another questions :::
How i bind a key correctly, example: "enter" for login
is necesary to use the guisetimput function?.
in the forum says that the fucntion that the key will call should be this way:
function functionName ( string key, string keyState, [ var arguments, ... ] )
it means that an fuction should be like this?
function loginbuttonfunction ("enter", "down")
or this?
function loginbuttonfunction (string key, keyState)
The other question is if i add and event with a resource using addEvent function this event can be used/handled whit other resource? or i need to add the event in every resource i want to use? or is not recomended?
i not write/speak perfect english sorry, thanks in advance [[ goole traslator phrase ]].