Jump to content

[HELP] Announce script


Enargy,

Recommended Posts

hello, I have this simple announce script but I have an error when text is sent, the text is too long for the Label. is there any way to use the simbol "\n" for the label ?

client-side

timer = 8000 
  
addEventHandler("onClientResourceStart",resourceRoot,  
function() 
ad = guiCreateLabel(189, 10, 643, 109,"", false) 
guiSetFont(ad,"sa-header") 
guiSetVisible(ad, false) 
  
end) 
  
addEvent("show.gui",true) 
addEventHandler("show.gui",getRootElement(), 
function() 
    showGUI() 
end) 
  
function showGUI() 
    window = guiCreateWindow(263, 196, 401, 144,"write your text bellow",false) 
    guiWindowSetSizable(window, false) 
     
    edit = guiCreateEdit(11, 48, 376, 36,"",false,window) 
    ok = guiCreateButton(233, 99, 95, 35,"OK",false,window) 
    close = guiCreateButton(90, 99, 95, 35,"Close",false,window) 
     
    showCursor(guiGetVisible(window)) 
     
     
end 
  
addEventHandler("onClientGUIClick",root, 
function() 
if (source == ok) then 
local text = guiGetText(edit) 
triggerServerEvent("show.text",localPlayer,text) 
end 
end) 
  
addEvent ("set.text", true) 
addEventHandler ("set.text", getRootElement(), 
function (text) 
guiSetText(ad,text) 
guiSetVisible(ad,true) 
setTimer( 
guiSetVisible,timer,1,ad, 
false) 
end) 
  
addEventHandler("onClientGUIClick",root, 
function () 
if (source == close) then 
guiSetVisible(window,false) 
showCursor(guiGetVisible(window)) 
end 
end) 

Regards.

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