Tete omar Posted June 18, 2012 Posted June 18, 2012 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
TAPL Posted June 18, 2012 Posted June 18, 2012 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)
Tete omar Posted June 18, 2012 Author Posted June 18, 2012 guiSetText(GUIEditor_Memo[1], guiGetText(GUIEditor_Edit[2])) -- is that right ? no thing shown up on GUIEditor_Memo[1] tapl
TAPL Posted June 18, 2012 Posted June 18, 2012 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)
Stanley Sathler Posted June 18, 2012 Posted June 18, 2012 Oh, just one thing: you can use "state" to store the button used by player (state == "left"), but it is not good. In the next times, rename your variable to "button" (button == "left"). It will be better. (:
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