Simple0x47 Posted July 18, 2015 Posted July 18, 2015 Hello i'm working at a roleplay test, and there's a problem, that the gui and the dxdraw doesn't appear on the screen. I don't know whats happening, help me please. Here the code: function greetingHandler ( ) Panel = guiCreateWindow(395, 345, 504, 574, "Desert Valley RP", true) guiWindowSetSizable(Panel, false) guiSetAlpha(Panel, 100) Todoloquesevaaenviar = guiCreateMemo(362, 399, 562, 414, "", true, Panel) Enviar = guiCreateButton(371, 857, 553, 40, "Enviar", true, Panel) guiSetProperty(Enviar, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", Enviar, EnviarGM) guiSetInputMode("no_binds_when_editing") nombre = getCharactherName ("localPlayer") preguntas = {"Pregunta ID1 - Explica los conceptos: RK-PK-CK-DM-PG-MG-CJ y ¿qué harias si alguien te apuntarÃa a la cabeza con un arma en medio de la calle?, Pregunta ID2""} dxDrawRectangle(323, 107, 636, 842, tocolor(0, 0, 0, 255), true) dxDrawText("Cuestionario de Roleplay", 347, 107, 934, 220, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "center", true, true, true, false, false) dxDrawRectangle(352, 286, 582, 632, tocolor(242, 230, 38, 255), true) dxDrawText(..preguntas[rand], 362, 303, 920, 377, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, false, false) dxDrawText("*Menciona la ID de la Pregunta que te ha tocado. Ejemplo: Pregunta ID-1.", 364, 821, 924, 842, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", true, true, true, false, false) dxDrawText("Nombre y Apellidos:", 347, 230, 467, 265, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", true, true, true, false, false) dxDrawText(..nombre, 472, 230, 652, 265, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "center", true, true, true, false, false) end addEvent( "onTestFailed", true ) addEventHandler( "onTestFailed", getLocalPlayer(), greetingHandler ) addEventHandler("onClientRender", getRootElement(), greetingHandler )
Death Posted July 18, 2015 Posted July 18, 2015 try this addEvent( "onTestFailed", true ) function greetingHandler ( ) Panel = guiCreateWindow(395, 345, 504, 574, "Desert Valley RP", true) guiWindowSetSizable(Panel, false) guiSetAlpha(Panel, 100) Todoloquesevaaenviar = guiCreateMemo(362, 399, 562, 414, "", true, Panel) Enviar = guiCreateButton(371, 857, 553, 40, "Enviar", true, Panel) guiSetProperty(Enviar, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", Enviar, EnviarGM) guiSetInputMode("no_binds_when_editing") nombre = getCharactherName ("localPlayer") preguntas = {"Pregunta ID1 - Explica los conceptos: RK-PK-CK-DM-PG-MG-CJ y ¿qué harias si alguien te apuntarÃa a la cabeza con un arma en medio de la calle?, Pregunta ID2"} dxDrawRectangle(323, 107, 636, 842, tocolor(0, 0, 0, 255), true) dxDrawText("Cuestionario de Roleplay", 347, 107, 934, 220, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "center", true, true, true, false, false) dxDrawRectangle(352, 286, 582, 632, tocolor(242, 230, 38, 255), true) dxDrawText(..preguntas[rand], 362, 303, 920, 377, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, false, false) dxDrawText("*Menciona la ID de la Pregunta que te ha tocado. Ejemplo: Pregunta ID-1.", 364, 821, 924, 842, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", true, true, true, false, false) dxDrawText("Nombre y Apellidos:", 347, 230, 467, 265, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", true, true, true, false, false) dxDrawText(..nombre, 472, 230, 652, 265, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "center", true, true, true, false, false) end addEventHandler( "onTestFailed", getLocalPlayer(), function() addEventHandler("onClientRender", getRootElement(), greetingHandler ) end )
Death Posted July 18, 2015 Posted July 18, 2015 try this function greetingHandler ( ) Panel = guiCreateWindow(395, 345, 504, 574, "Desert Valley RP", true) guiWindowSetSizable(Panel, false) guiSetAlpha(Panel, 100) Todoloquesevaaenviar = guiCreateMemo(362, 399, 562, 414, "", true, Panel) Enviar = guiCreateButton(371, 857, 553, 40, "Enviar", true, Panel) guiSetProperty(Enviar, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", Enviar, EnviarGM) guiSetInputMode("no_binds_when_editing") nombre = getCharactherName ("localPlayer") preguntas = {"Pregunta ID1 - Explica los conceptos: RK-PK-CK-DM-PG-MG-CJ y ¿qué harias si alguien te apuntarÃa a la cabeza con un arma en medio de la calle?, Pregunta ID2"} dxDrawRectangle(323, 107, 636, 842, tocolor(0, 0, 0, 255), true) dxDrawText("Cuestionario de Roleplay", 347, 107, 934, 220, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "center", true, true, true, false, false) dxDrawRectangle(352, 286, 582, 632, tocolor(242, 230, 38, 255), true) dxDrawText(preguntas[rand], 362, 303, 920, 377, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", true, true, true, false, false) dxDrawText("*Menciona la ID de la Pregunta que te ha tocado. Ejemplo: Pregunta ID-1.", 364, 821, 924, 842, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", true, true, true, false, false) dxDrawText("Nombre y Apellidos:", 347, 230, 467, 265, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", true, true, true, false, false) dxDrawText(nombre, 472, 230, 652, 265, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "center", true, true, true, false, false) end addEventHandler("onClientRender", getRootElement(), greetingHandler )
Simple0x47 Posted July 18, 2015 Author Posted July 18, 2015 It doesn't function, everytime i try to put a dxdraw it doesn't appear or a gui. It's maybe because the MTA Paradise produces an error or something?
Simple0x47 Posted July 18, 2015 Author Posted July 18, 2015 Thanks for the help. I thing there's no answer for this.
xeon17 Posted July 18, 2015 Posted July 18, 2015 You're creating the GUI elements in the render what is totaly wrong. Create them once when the resource starts using the event onClientResourceStart. If this doesn't help the problem could be line 14 since the function getCharactherName isn't defined in your code.
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