Jump to content

[Ayuda]dxAnuncios


_SAXI_

Recommended Posts

Hola

Bueno estaba trabajando en un script super facil, pero al parecer no es tan facil para mi xD.

Bueno, les explico.

al mandar el comando "gmsg" se nos abre una gui donde podemos escribir lo que queramos al hacer click en el boton "Enviar" se nos aparecerá un dxText.

Mi problema es que al mandar el mensaje me arroja lo siguiente:

2eqchg9.png

Aca el codigo

  
btn = {}Lbl = {} 
mgv = guiCreateWindow(262, 241, 291, 129, "Mensaje global", false) 
guiWindowSetSizable(mgv, false) 
guiSetVisible(mgv,false) 
btn[1] = guiCreateButton(200, 61, 82, 26, "Enviar", false, mgv) 
btn[2] = guiCreateButton(9, 94, 82, 26, "Cancelar", false, mgv) 
mge = guiCreateEdit(9, 64, 189, 20, "", false, mgv) 
Lbl[1] = guiCreateLabel(17, 33, 253, 15, "INTRODUCE EL MENSAJE", false, mgv) 
guiSetFont(Lbl[1], "default-bold-small") 
guiLabelSetHorizontalAlign(Lbl[1], "center", false) 
guiLabelSetVerticalAlign(Lbl[1], "center") 
Lbl[2] = guiCreateLabel(102, 107, 183, 15, "Attack of the Terrorist!", false, mgv) 
guiSetFont(Lbl[2], "default-bold-small") 
guiLabelSetColor(Lbl[2], 30, 30, 30) 
guiLabelSetHorizontalAlign(Lbl[2], "center", false) 
guiLabelSetVerticalAlign(Lbl[2], "center") 
  
addCommandHandler("gmsg",function()guiSetVisible(mgv,true)showCursor(true)end) 
  
msj = guiGetText(mge) 
addEventHandler("onClientGUIClick",root,function(msj) 
if btn[1] == source and msj ~= "" then 
addEventHandler("onClientRender",root,envio) 
setTimer(function()removeEventHandler("onClientRender",root,envio)end,2000,1) 
elseif source == btn[2] then 
guiSetVisible(mgv,false)showCursor(false) 
end end) 
  
function envio(msj) 
dxDrawText(tostring(mge), 0, -2, 799, 598, tocolor(200, 0, 0, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) 
end 
  

Bueno, eso sería gracias de ante mano

Link to comment
  
btn = {}Lbl = {} 
mgv = guiCreateWindow(262, 241, 291, 129, "Mensaje global", false) 
guiWindowSetSizable(mgv, false) 
guiSetVisible(mgv,false) 
btn[1] = guiCreateButton(200, 61, 82, 26, "Enviar", false, mgv) 
btn[2] = guiCreateButton(9, 94, 82, 26, "Cancelar", false, mgv) 
mge = guiCreateEdit(9, 64, 189, 20, "", false, mgv) 
Lbl[1] = guiCreateLabel(17, 33, 253, 15, "INTRODUCE EL MENSAJE", false, mgv) 
guiSetFont(Lbl[1], "default-bold-small") 
guiLabelSetHorizontalAlign(Lbl[1], "center", false) 
guiLabelSetVerticalAlign(Lbl[1], "center") 
Lbl[2] = guiCreateLabel(102, 107, 183, 15, "Attack of the Terrorist!", false, mgv) 
guiSetFont(Lbl[2], "default-bold-small") 
guiLabelSetColor(Lbl[2], 30, 30, 30) 
guiLabelSetHorizontalAlign(Lbl[2], "center", false) 
guiLabelSetVerticalAlign(Lbl[2], "center") 
  
addCommandHandler("gmsg",function()guiSetVisible(mgv,true)showCursor(true)end) 
  
addEventHandler("onClientGUIClick",root,function() 
local msj = guiGetText(mge) 
if btn[1] == source and msj ~= "" then 
text = msj 
addEventHandler("onClientRender",root,envio) 
setTimer(function()removeEventHandler("onClientRender",root,envio)end,2000,1) 
elseif source == btn[2] then 
guiSetVisible(mgv,false)showCursor(false) 
end end) 
  
function envio() 
dxDrawText(tostring(text), 0, -2, 799, 598, tocolor(200, 0, 0, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) 
end 
  

'mge' es un label, no un string, utiliza eso.

Edited by Guest
Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...