Jump to content

guiEdit to guiMemo.


Tete omar

Recommended Posts

I tried to combine gui-edit with gui-memo.

client side

function furbo(state) 
    if state == "left" then 
       if ( source == GUIEditor_Button[4] ) then 
           local Player = getLocalPlayer() 
           local thetext = guiGetText(GUIEditor_Edit[2]) 
           if thetext ~= "" then 
           triggerServerEvent("SendHelp", getLocalPlayer(), Player, thetext) 
           guiSetText(GUIEditor_Edit[2], "") 
                   guiSetText(GUIEditor_Memo[1], "") -- is that right ? 
           else 
           outputChatBox("You didn't typed any thing", 255, 255, 0 ) 
             
                end 
            end 
        end 
    end 
addEventHandler("onClientGUIClick", getRootElement(), furbo) 
addEventHandler("onClientGUIAccepted", GUIEditor_Edit[2], furbo) 

server side

addEvent("SendHelp", true) 
function SendHelp (Player, thetext) 
    local name = getPlayerName(Player) 
    if not isPlayerMuted (Player) then 
    outputChatBox("* [ Request ]  "..name..": #00FFF7"..thetext, getRootElement(),255,0,0,true) 
    else 
    outputChatBox("You're globally muted", Player,255,0,0,true) 
    end 
end 
addEventHandler("SendHelp", getRootElement(), SendHelp) 

i saw this issue in many of servers and i don't know how that works

i would be thankful if you at least gave me a little example

Link to comment
  • Other Languages Moderators

You want copy the text in edit and put it in memo?

if so

function furbo(state) 
    if state == "left" then 
       if ( source == GUIEditor_Button[4] ) then 
           local Player = getLocalPlayer() 
           local thetext = guiGetText(GUIEditor_Edit[2]) 
           if thetext ~= "" then 
           triggerServerEvent("SendHelp", getLocalPlayer(), Player, thetext) 
           guiSetText(GUIEditor_Edit[2], "") 
                   guiSetText(GUIEditor_Memo[1], guiGetText(GUIEditor_Edit[2])) -- is that right ? 
           else 
           outputChatBox("You didn't typed any thing", 255, 255, 0 ) 
            
                end 
            end 
        end 
    end 
addEventHandler("onClientGUIClick", getRootElement(), furbo) 
addEventHandler("onClientGUIAccepted", GUIEditor_Edit[2], furbo) 

Link to comment
  • Other Languages Moderators

oh my bad

function furbo(state) 
    if state == "left" then 
       if ( source == GUIEditor_Button[4] ) then 
           local Player = getLocalPlayer() 
           local thetext = guiGetText(GUIEditor_Edit[2]) 
           if thetext ~= "" then 
           triggerServerEvent("SendHelp", getLocalPlayer(), Player, thetext) 
                   guiSetText(GUIEditor_Memo[1], guiGetText(GUIEditor_Edit[2])) -- is that right ? 
                   guiSetText(GUIEditor_Edit[2], "") 
           else 
           outputChatBox("You didn't typed any thing", 255, 255, 0 ) 
            
                end 
            end 
        end 
    end 
addEventHandler("onClientGUIClick", getRootElement(), furbo) 
addEventHandler("onClientGUIAccepted", GUIEditor_Edit[2], furbo) 

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