Tete omar Posted May 30, 2012 Share Posted May 30, 2012 GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Edit = {} GUIEditor_Memo = {} GUIEditor_Window[1] = guiCreateWindow(167,128,949,523,"Chats",false) guiSetVisible(GUIEditor_Window[1], false) GUIEditor_TabPanel[1] = guiCreateTabPanel(32,39,893,460,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Help",GUIEditor_TabPanel[1]) GUIEditor_Edit[1] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[1]) GUIEditor_Memo[1] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[1]) guiMemoSetReadOnly(GUIEditor_Memo[1],true) GUIEditor_Tab[2] = guiCreateTab("Main",GUIEditor_TabPanel[1]) GUIEditor_Edit[2] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[2]) GUIEditor_Memo[2] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[2]) guiMemoSetReadOnly(GUIEditor_Memo[2],true) GUIEditor_Tab[3] = guiCreateTab("Arabic",GUIEditor_TabPanel[1]) GUIEditor_Edit[3] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[3]) GUIEditor_Memo[3] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[3]) guiMemoSetReadOnly(GUIEditor_Memo[3],true) GUIEditor_Tab[4] = guiCreateTab("Russian",GUIEditor_TabPanel[1]) GUIEditor_Edit[4] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[4]) GUIEditor_Memo[4] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[4]) guiMemoSetReadOnly(GUIEditor_Memo[4],true) GUIEditor_Tab[5] = guiCreateTab("Spanish",GUIEditor_TabPanel[1]) GUIEditor_Edit[5] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[5]) GUIEditor_Memo[5] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[5]) guiMemoSetReadOnly(GUIEditor_Memo[5],true) GUIEditor_Tab[6] = guiCreateTab("Turkish",GUIEditor_TabPanel[1]) GUIEditor_Edit[6] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[6]) GUIEditor_Memo[6] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[6]) guiMemoSetReadOnly(GUIEditor_Memo[6],true) GUIEditor_Tab[7] = guiCreateTab("French",GUIEditor_TabPanel[1]) GUIEditor_Edit[7] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[7]) GUIEditor_Memo[7] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[7]) guiMemoSetReadOnly(GUIEditor_Memo[7],true) GUIEditor_Tab[8] = guiCreateTab("German",GUIEditor_TabPanel[1]) GUIEditor_Edit[8] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[8]) GUIEditor_Memo[8] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[8]) guiMemoSetReadOnly(GUIEditor_Memo[8],true) GUIEditor_Tab[9] = guiCreateTab("Indian",GUIEditor_TabPanel[1]) GUIEditor_Edit[9] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[9]) GUIEditor_Memo[9] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[9]) guiMemoSetReadOnly(GUIEditor_Memo[9],true) GUIEditor_Tab[10] = guiCreateTab("Ireland",GUIEditor_TabPanel[1]) GUIEditor_Edit[10] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[10]) GUIEditor_Memo[10] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[10]) guiMemoSetReadOnly(GUIEditor_Memo[10],true) GUIEditor_Tab[11] = guiCreateTab("Italian",GUIEditor_TabPanel[1]) GUIEditor_Edit[11] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[11]) GUIEditor_Memo[11] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[11]) guiMemoSetReadOnly(GUIEditor_Memo[11],true) GUIEditor_Tab[12] = guiCreateTab("Portuguese",GUIEditor_TabPanel[1]) GUIEditor_Edit[12] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[12]) GUIEditor_Memo[12] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[12]) guiMemoSetReadOnly(GUIEditor_Memo[12],true) bindKey('f2','down',function() guiSetVisible(GUIEditor_Window[1],not guiGetVisible(GUIEditor_Window[1])) showCursor(guiGetVisible(GUIEditor_Window[1])) end) i want here when i type anything in Edit then it show up in Memo but when i type in help tap it show up in main chat like that support 'playername', also in help tab and when the player type /help ' and type here what the player want ' then it also show up in help tab and main chat as support 'playername' and the other languages only private just like when the Spanish player wanted to talk to his country peoples then he should talk here GUIEditor_Tab[5] = guiCreateTab("Spanish",GUIEditor_TabPanel[1]) hope you understood me thanks for all. Link to comment
Flaker Posted May 30, 2012 Share Posted May 30, 2012 Try this, but not sure cuz UNTESTED: p.s. U should create buttons for Send Text function (For example: SendRus; SendSpan etc...) if (source == SendRus) then - it mean: if player click on "SendRus" button, then do something... etc. --CLIENT SIDE GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Edit = {} GUIEditor_Memo = {} GUIEditor_Window[1] = guiCreateWindow(167,128,949,523,"Chats",false) guiSetVisible(GUIEditor_Window[1], false) GUIEditor_TabPanel[1] = guiCreateTabPanel(32,39,893,460,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Help",GUIEditor_TabPanel[1]) GUIEditor_Edit[1] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[1]) GUIEditor_Memo[1] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[1]) guiMemoSetReadOnly(GUIEditor_Memo[1],true) GUIEditor_Tab[2] = guiCreateTab("Main",GUIEditor_TabPanel[1]) GUIEditor_Edit[2] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[2]) GUIEditor_Memo[2] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[2]) guiMemoSetReadOnly(GUIEditor_Memo[2],true) GUIEditor_Tab[3] = guiCreateTab("Arabic",GUIEditor_TabPanel[1]) GUIEditor_Edit[3] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[3]) GUIEditor_Memo[3] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[3]) guiMemoSetReadOnly(GUIEditor_Memo[3],true) GUIEditor_Tab[4] = guiCreateTab("Russian",GUIEditor_TabPanel[1]) GUIEditor_Edit[4] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[4]) GUIEditor_Memo[4] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[4]) guiMemoSetReadOnly(GUIEditor_Memo[4],true) GUIEditor_Tab[5] = guiCreateTab("Spanish",GUIEditor_TabPanel[1]) GUIEditor_Edit[5] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[5]) GUIEditor_Memo[5] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[5]) guiMemoSetReadOnly(GUIEditor_Memo[5],true) GUIEditor_Tab[6] = guiCreateTab("Turkish",GUIEditor_TabPanel[1]) GUIEditor_Edit[6] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[6]) GUIEditor_Memo[6] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[6]) guiMemoSetReadOnly(GUIEditor_Memo[6],true) GUIEditor_Tab[7] = guiCreateTab("French",GUIEditor_TabPanel[1]) GUIEditor_Edit[7] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[7]) GUIEditor_Memo[7] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[7]) guiMemoSetReadOnly(GUIEditor_Memo[7],true) GUIEditor_Tab[8] = guiCreateTab("German",GUIEditor_TabPanel[1]) GUIEditor_Edit[8] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[8]) GUIEditor_Memo[8] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[8]) guiMemoSetReadOnly(GUIEditor_Memo[8],true) GUIEditor_Tab[9] = guiCreateTab("Indian",GUIEditor_TabPanel[1]) GUIEditor_Edit[9] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[9]) GUIEditor_Memo[9] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[9]) guiMemoSetReadOnly(GUIEditor_Memo[9],true) GUIEditor_Tab[10] = guiCreateTab("Ireland",GUIEditor_TabPanel[1]) GUIEditor_Edit[10] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[10]) GUIEditor_Memo[10] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[10]) guiMemoSetReadOnly(GUIEditor_Memo[10],true) GUIEditor_Tab[11] = guiCreateTab("Italian",GUIEditor_TabPanel[1]) GUIEditor_Edit[11] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[11]) GUIEditor_Memo[11] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[11]) guiMemoSetReadOnly(GUIEditor_Memo[11],true) GUIEditor_Tab[12] = guiCreateTab("Portuguese",GUIEditor_TabPanel[1]) GUIEditor_Edit[12] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[12]) GUIEditor_Memo[12] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[12]) guiMemoSetReadOnly(GUIEditor_Memo[12],true) addEventHandler("onClientGUIClick",root, --U should create Buttons for send Player's msg! (For example: SendRus; SendSpan etc...) function () if (source == SendRus) then --If player click on "SendRus" button then local msg = guiGetText ( GUIEditor_Edit[4] ) --We get player's message from GUIEditor_Edit[4] triggerServerEvent ( "setMemoText", localPlayer, localPlayer, GUIEditor_Memo[4], msg) elseif (source == SendSpan) then local msg = guiGetText ( GUIEditor_Edit[5] ) triggerServerEvent ( "setMemoText", localPlayer, localPlayer, GUIEditor_Memo[5], msg) end end ) bindKey('f2','down',function() guiSetVisible(GUIEditor_Window[1],not(guiGetVisible(GUIEditor_Window[1]))) showCursor(guiGetVisible(GUIEditor_Window[1])) end) --SERVER SIDE function setMemoTextInLines (MemoElement, thePlayer, Text) local pNick = getPlayerName ( thePlayer ) local cur_text = guiGetText ( MemoElement ) guiSetText ( MemoElement, cur_text.."\n"..pNick..":"..Text) end addEvent ( "setMemoText", true ) addEventHandler ( "setMemoText", root, function ( thePlayer, MemoElement, Text ) setMemoTextInLines (MemoElement, thePlayer, Text) end ) addCommandHandler ( "help", function ( player, cmd, ... ) local text = table.concat ( { ... }, " " ) if (text) then local msg = tostring(text) setMemoTextInLines (GUIEditor_Memo[1], player, msg) else outputChatBox("[usage] /help [TEXT]",player,0,255,0) end end ) Link to comment
myonlake Posted June 1, 2012 Share Posted June 1, 2012 Try this, but not sure cuz UNTESTED:p.s. U should create buttons for Send Text function (For example: SendRus; SendSpan etc...) if (source == SendRus) then - it mean: if player click on "SendRus" button, then do something... etc. --CLIENT SIDE GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Edit = {} GUIEditor_Memo = {} GUIEditor_Window[1] = guiCreateWindow(167,128,949,523,"Chats",false) guiSetVisible(GUIEditor_Window[1], false) GUIEditor_TabPanel[1] = guiCreateTabPanel(32,39,893,460,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Help",GUIEditor_TabPanel[1]) GUIEditor_Edit[1] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[1]) GUIEditor_Memo[1] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[1]) guiMemoSetReadOnly(GUIEditor_Memo[1],true) GUIEditor_Tab[2] = guiCreateTab("Main",GUIEditor_TabPanel[1]) GUIEditor_Edit[2] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[2]) GUIEditor_Memo[2] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[2]) guiMemoSetReadOnly(GUIEditor_Memo[2],true) GUIEditor_Tab[3] = guiCreateTab("Arabic",GUIEditor_TabPanel[1]) GUIEditor_Edit[3] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[3]) GUIEditor_Memo[3] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[3]) guiMemoSetReadOnly(GUIEditor_Memo[3],true) GUIEditor_Tab[4] = guiCreateTab("Russian",GUIEditor_TabPanel[1]) GUIEditor_Edit[4] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[4]) GUIEditor_Memo[4] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[4]) guiMemoSetReadOnly(GUIEditor_Memo[4],true) GUIEditor_Tab[5] = guiCreateTab("Spanish",GUIEditor_TabPanel[1]) GUIEditor_Edit[5] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[5]) GUIEditor_Memo[5] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[5]) guiMemoSetReadOnly(GUIEditor_Memo[5],true) GUIEditor_Tab[6] = guiCreateTab("Turkish",GUIEditor_TabPanel[1]) GUIEditor_Edit[6] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[6]) GUIEditor_Memo[6] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[6]) guiMemoSetReadOnly(GUIEditor_Memo[6],true) GUIEditor_Tab[7] = guiCreateTab("French",GUIEditor_TabPanel[1]) GUIEditor_Edit[7] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[7]) GUIEditor_Memo[7] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[7]) guiMemoSetReadOnly(GUIEditor_Memo[7],true) GUIEditor_Tab[8] = guiCreateTab("German",GUIEditor_TabPanel[1]) GUIEditor_Edit[8] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[8]) GUIEditor_Memo[8] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[8]) guiMemoSetReadOnly(GUIEditor_Memo[8],true) GUIEditor_Tab[9] = guiCreateTab("Indian",GUIEditor_TabPanel[1]) GUIEditor_Edit[9] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[9]) GUIEditor_Memo[9] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[9]) guiMemoSetReadOnly(GUIEditor_Memo[9],true) GUIEditor_Tab[10] = guiCreateTab("Ireland",GUIEditor_TabPanel[1]) GUIEditor_Edit[10] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[10]) GUIEditor_Memo[10] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[10]) guiMemoSetReadOnly(GUIEditor_Memo[10],true) GUIEditor_Tab[11] = guiCreateTab("Italian",GUIEditor_TabPanel[1]) GUIEditor_Edit[11] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[11]) GUIEditor_Memo[11] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[11]) guiMemoSetReadOnly(GUIEditor_Memo[11],true) GUIEditor_Tab[12] = guiCreateTab("Portuguese",GUIEditor_TabPanel[1]) GUIEditor_Edit[12] = guiCreateEdit(25,388,762,35,"",false,GUIEditor_Tab[12]) GUIEditor_Memo[12] = guiCreateMemo(23,27,791,339,"",false,GUIEditor_Tab[12]) guiMemoSetReadOnly(GUIEditor_Memo[12],true) addEventHandler("onClientGUIClick",root, --U should create Buttons for send Player's msg! (For example: SendRus; SendSpan etc...) function () if (source == SendRus) then --If player click on "SendRus" button then local msg = guiGetText ( GUIEditor_Edit[4] ) --We get player's message from GUIEditor_Edit[4] triggerServerEvent ( "setMemoText", localPlayer, localPlayer, GUIEditor_Memo[4], msg) elseif (source == SendSpan) then local msg = guiGetText ( GUIEditor_Edit[5] ) triggerServerEvent ( "setMemoText", localPlayer, localPlayer, GUIEditor_Memo[5], msg) end end ) bindKey('f2','down',function() guiSetVisible(GUIEditor_Window[1],not(guiGetVisible(GUIEditor_Window[1]))) showCursor(guiGetVisible(GUIEditor_Window[1])) end) --SERVER SIDE function setMemoTextInLines (MemoElement, thePlayer, Text) local pNick = getPlayerName ( thePlayer ) local cur_text = guiGetText ( MemoElement ) guiSetText ( MemoElement, cur_text.."\n"..pNick..":"..Text) end addEvent ( "setMemoText", true ) addEventHandler ( "setMemoText", root, function ( thePlayer, MemoElement, Text ) setMemoTextInLines (MemoElement, thePlayer, Text) end ) addCommandHandler ( "help", function ( player, cmd, ... ) local text = table.concat ( { ... }, " " ) if (text) then local msg = tostring(text) setMemoTextInLines (GUIEditor_Memo[1], player, msg) else outputChatBox("[usage] /help [TEXT]",player,0,255,0) end end ) Binds are better. Link to comment
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