Jump to content

Help


yMassai

Recommended Posts

Hi how are you?

I need a little help basic ,do not know very well create windows.

In this example I created a window with a button and a place for text.

In this text players can edit what is written, I want this to be intact, ie no one can remove what is written in place of text.

infoWindow = guiCreateWindow(350,250,450,320,"Painel Info",false) 
guiCreateButton(15,40,105,35,"Regras",false,infoWindow) 
guiCreateMemo(135,40,300,260,"Test text",false,infoWindow) 
guiWindowSetSizable(infoWindow,false) 
guiSetVisible( infoWindow, false ) 
  
function infoShow () 
    guiSetVisible( infoWindow, not guiGetVisible( infoWindow ) ) 
    showCursor( not isCursorShowing( ) ) 
end 
bindKey ("F1", "down", infoShow ) 

Link to comment

try it :D

infoWindow = guiCreateWindow(350,250,450,320,"Painel Info",false) 
guiCreateButton(15,40,105,35,"Regras",false,infoWindow) 
memo = guiCreateMemo(135,40,300,260,"Test text",false,infoWindow) 
guiMemoSetReadOnly( memo, true ) 
guiWindowSetSizable(infoWindow,false) 
guiSetVisible( infoWindow, false ) 
  
function infoShow () 
    guiSetVisible( infoWindow, not guiGetVisible( infoWindow ) ) 
    showCursor( not isCursorShowing( ) ) 
end 
bindKey ("F1", "down", infoShow ) 

Link to comment

Here again i

this time I would like another helping hand.

as we see there are two buttons and two texts.

I would like to open for example:

I want the text arises "Memo1" when tightening "Regras", and also that when I push the button "Infor", the text "Memo2" to emerge in place of text "Memo1".

infoWindow = guiCreateWindow(350,250,450,320,"Painel Info",false) 
guiCreateButton(15,40,105,35,"Regras",false,infoWindow) 
memo1 = guiCreateMemo(135,40,300,260,"Test text",false,infoWindow) 
guiMemoSetReadOnly( memo1, true ) 
guiWindowSetSizable(infoWindow,false) 
guiSetVisible( infoWindow, false ) 
  
function infoShow () 
    guiSetVisible( infoWindow, not guiGetVisible( infoWindow ) ) 
    showCursor( not isCursorShowing( ) ) 
end 
bindKey ("F1", "down", infoShow ) 

guiCreateButton(15,80,105,35,"Infor",false,infoWindow) 
memo2 = guiCreateMemo(135,40,300,260,"Test text",false,infoWindow) 
guiMemoSetReadOnly( memo2, true ) 

Link to comment

mmm try it

infoWindow = guiCreateWindow(350,250,450,320,"Painel Info",false) 
guiCreateButton(15,40,105,35,"Regras",false,infoWindow) 
memo1 = guiCreateMemo(135,40,300,260,"Test text",false,infoWindow) 
guiMemoSetReadOnly( memo1, true ) 
guiWindowSetSizable(infoWindow,false) 
guiSetVisible( infoWindow, false ) 
-------------------------------------------------------- 
button = guiCreateButton(15,80,105,35,"Infor",false,infoWindow) 
memo2 = guiCreateMemo(135,40,300,260,"Test text",false,infoWindow) 
guiMemoSetReadOnly( memo2, true ) 
  
function infoShow () 
    guiSetVisible( infoWindow, not guiGetVisible( infoWindow ) ) 
    showCursor( not isCursorShowing( ) ) 
end 
bindKey ("F1", "down", infoShow ) 
  
addEventHandler("onClientGUIClick", root,  
function() 
if source == button then 
guiSetText( memo2, " guiGetText( memo1 ) " 
end 
end 
) 

if doesnt work please tell me :D

Link to comment
infoWindow = guiCreateWindow(350,250,450,320,"Painel Info",false) 
guiCreateButton(15,40,105,35,"Regras",false,infoWindow) 
memo1 = guiCreateMemo(135,40,300,260,"Test text",false,infoWindow) 
guiMemoSetReadOnly( memo1, true ) 
guiWindowSetSizable(infoWindow,false) 
guiSetVisible( infoWindow, false ) 
-------------------------------------------------------- 
button = guiCreateButton(15,80,105,35,"Infor",false,infoWindow) 
memo2 = guiCreateMemo(135,40,300,260,"Test text",false,infoWindow) 
guiMemoSetReadOnly( memo2, true ) 
  
function infoShow ( ) 
    guiSetVisible ( infoWindow, not guiGetVisible ( infoWindow ) ) 
    showCursor ( not isCursorShowing( ) ) 
end 
bindKey ( "F1", "down", infoShow ) 
  
addEventHandler ( "onClientGUIClick", root, 
    function ( ) 
        if ( source == button ) then 
            guiSetText ( memo1, guiGetText( memo2 ) ) 
        end 
    end 
) 

Link to comment
infoWindow = guiCreateWindow(350,250,450,320,"Painel Info",false) 
guiCreateButton(15,40,105,35,"Regras",false,infoWindow) 
memo1 = guiCreateMemo(135,40,300,260,"Test text 11111111",false,infoWindow) 
guiMemoSetReadOnly( memo1, true ) 
guiWindowSetSizable(infoWindow,false) 
guiSetVisible( infoWindow, false ) 
-------------------------------------------------------- 
button = guiCreateButton(15,80,105,35,"Infor",false,infoWindow) 
memo2 = guiCreateMemo(135,40,300,260,"Test text 2222222",false,infoWindow) 
guiMemoSetReadOnly( memo2, true ) 
  
function infoShow ( ) 
    guiSetVisible ( infoWindow, not guiGetVisible ( infoWindow ) ) 
    showCursor ( not isCursorShowing( ) ) 
end 
bindKey ( "F1", "down", infoShow ) 
  
addEventHandler ( "onClientGUIClick", root, 
    function ( ) 
        if ( source == button ) then 
            guiSetText ( memo1, guiGetText( memo2 ) ) 
        end 
    end 
) 

Dont work.

Link to comment

I test ur GUI in my server and it is better :D

  
infoWindow = guiCreateWindow(350,250,450,320,"Painel Info",false) 
button = guiCreateButton(15,40,105,35,"Regras",false,infoWindow) 
memo1 = guiCreateMemo(135,40,300,260,"text",false,infoWindow) 
guiMemoSetReadOnly( memo1, true ) 
guiWindowSetSizable(infoWindow,false) 
guiSetVisible( infoWindow, false ) 
-------------------------------------------------------- 
button = guiCreateButton(15,80,105,35,"Infor",false,infoWindow) 
memo2 = guiCreateMemo(135,40,300,260,"text",false,infoWindow) 
guiMemoSetReadOnly( memo2, true ) 
  
function infoShow ( ) 
    guiSetVisible ( infoWindow, not guiGetVisible ( infoWindow ) ) 
    showCursor ( not isCursorShowing( ) ) 
end 
bindKey ( "F1","down", infoShow ) 
  
addEventHandler ( "onClientGUIClick", root, 
    function ( ) 
        if ( source == button ) then 
            guiSetVisible( memo2, true ) 
            guiSetVisible( memo1, false ) 
        elseif ( source == button2 ) then 
            guiSetVisible( memo1, true ) 
            guiSetVisible( memo2, false ) 
        end 
    end 
) 

- I think u have a error in memo1 doesnt create only the memo2

EDIT SORY MY ERROR XDD now it code work 100%

  
infoWindow = guiCreateWindow(350,250,450,320,"Painel Info",false) 
button = guiCreateButton(15,40,105,35,"Regras",false,infoWindow) 
memo1 = guiCreateMemo(135,40,300,260,"text1",false,infoWindow) 
guiMemoSetReadOnly( memo1, true ) 
guiWindowSetSizable(infoWindow,false) 
guiSetVisible( infoWindow, false ) 
-------------------------------------------------------- 
button2 = guiCreateButton(15,80,105,35,"Infor",false,infoWindow) 
memo2 = guiCreateMemo(135,40,300,260,"text2",false,infoWindow) 
guiMemoSetReadOnly( memo2, true ) 
  
function infoShow ( ) 
    guiSetVisible ( infoWindow, not guiGetVisible ( infoWindow ) ) 
    showCursor ( not isCursorShowing( ) ) 
end 
bindKey ( "F1","down", infoShow ) 
  
addEventHandler ( "onClientGUIClick", root, 
    function ( ) 
        if ( source == button ) then 
            guiSetVisible( memo2, true ) 
            guiSetVisible( memo1, false ) 
        elseif ( source == button2 ) then 
            guiSetVisible( memo1, true ) 
            guiSetVisible( memo2, false ) 
        end 
    end 
) 

Link to comment
infoWindow = guiCreateWindow(350,250,450,320,"Painel Info",false) 
button = guiCreateButton(15,40,105,35,"Regras",false,infoWindow) 
memo1 = guiCreateMemo(135,40,300,260,"text1",false,infoWindow) 
guiMemoSetReadOnly( memo1, true ) 
guiWindowSetSizable(infoWindow,false) 
guiSetVisible( infoWindow, false ) 
-------------------------------------------------------- 
button2 = guiCreateButton(15,80,105,35,"Infor",false,infoWindow) 
memo2 = guiCreateMemo(135,40,300,260,"text2",false,infoWindow) 
guiMemoSetReadOnly( memo2, true ) 
  
function infoShow ( ) 
    guiSetVisible ( infoWindow, not guiGetVisible ( infoWindow ) ) 
    showCursor ( not isCursorShowing( ) ) 
end 
bindKey ( "F1","down", infoShow ) 
  
addEventHandler ( "onClientGUIClick", root, 
    function ( ) 
        if ( source == button2 ) then 
            guiSetVisible( memo2, true ) 
            guiSetVisible( memo1, false ) 
        elseif ( source == button ) then 
            guiSetVisible( memo1, true ) 
            guiSetVisible( memo2, false ) 
        end 
    end 
) 

Work 100%

thank you very much

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