xRGamingx Posted February 2, 2016 Share Posted February 2, 2016 Hello, Who helps me? I want all the message appears on my panel Say support. I give myself to understand what I want is what message to write on Say window appears on the panel bracket say. Link to comment
Sir.BEEF Posted February 2, 2016 Share Posted February 2, 2016 You mean you want when someone ask something on the support chat you want to see it on the mainchat?? Link to comment
KariiiM Posted February 2, 2016 Share Posted February 2, 2016 You've to use onPlayerChat Link to comment
Bonus Posted February 2, 2016 Share Posted February 2, 2016 I can't understand anything ... Link to comment
xRGamingx Posted February 2, 2016 Author Share Posted February 2, 2016 You mean you want when someone ask something on the support chat you want to see it on the mainchat?? What I want is to see what the main support chat Link to comment
Bonus Posted February 2, 2016 Share Posted February 2, 2016 Sry, but I still dont understand anything. Can you perhaps show us an example? Link to comment
KariiiM Posted February 2, 2016 Share Posted February 2, 2016 I wrote for you an example complet it; function playerChat(msg, msgtype) if msgtype == 0 then --then make a trigger end end addEventHandler("onPlayerChat", root, playerChat) Use triggerServerEvent to pass the data betwen server and client. because onPlayerChat is server sided, to store what wrote in say chat into a grid list. Link to comment
Sir.BEEF Posted February 2, 2016 Share Posted February 2, 2016 Sry, but I still dont understand anything.Can you perhaps show us an example? He wants to see when someone type anything in support chat on mainchat. if you ever played SAUR, when someone ask for support it appears on mainchat. Link to comment
Sir.BEEF Posted February 2, 2016 Share Posted February 2, 2016 function playerChat(msg, msgtype) if msgtype == 0 then end end addEventHandler("onAdminChat", root, playerChat) use Wiki its clear there if you want to only admin to see it use mine. if you want all players use Karim one Link to comment
xRGamingx Posted February 2, 2016 Author Share Posted February 2, 2016 Sry, but I still dont understand anything.Can you perhaps show us an example? He wants to see when someone type anything in support chat on mainchat. if you ever played SAUR, when someone ask for support it appears on mainchat. You bring mainchat the same bracket as shown in the picture.. Link to comment
Sir.BEEF Posted February 2, 2016 Share Posted February 2, 2016 Can you show me the script Link to comment
xRGamingx Posted February 2, 2016 Author Share Posted February 2, 2016 Can you show me the script Yes Broth., Write me privately and I'll step Link to comment
Bonus Posted February 2, 2016 Share Posted February 2, 2016 Oh it should be easy. addEventHandler ( "onPlayerChat", root, function ( msg, typ ) if typ == 0 then local time = getRealTime() local timestring = "[".. time.hour ..":".. time.minute ..":".. time.second .."]" local text = getPlayerName ( source ) .. ": "..msg triggerClientEvent ( "updateChatInGUI", source, timestring, text ) end end Then use it clientsided with guiGridListAddRow and guiGridListSetItemText. For JOIN and QUIT you can use onPlayerJoin and onPlayerQuit. But I don't know what (LV) and (SF) is, if its the Zone you can get it with getZoneName. Link to comment
xRGamingx Posted February 2, 2016 Author Share Posted February 2, 2016 send it on pm Look MP Link to comment
KariiiM Posted February 3, 2016 Share Posted February 3, 2016 Yes follow Bonus's ways, that's what I told you Link to comment
Sir.BEEF Posted February 3, 2016 Share Posted February 3, 2016 I did the same what bonus said, his problem is not that he cant see the chat. there is an error and im not good at debugging Link to comment
KariiiM Posted February 3, 2016 Share Posted February 3, 2016 I did the same what bonus said, his problem is not that he cant see the chat. there is an error and im not good at debugging No matter just post what the error witch exist in debugscript on error /warning level , copy/past. Link to comment
xRGamingx Posted February 3, 2016 Author Share Posted February 3, 2016 Maybe show us the error? function playerChat(msg, msgtype) if msgtype == 0 then --then make a trigger end end addEventHandler("onPlayerChat", root, playerChat) /Debugscript 3/ Error error: Loading script failed: GPSoporte\Client.lua:225: ') expected (to close '('at time 218) near'" Link to comment
xRGamingx Posted February 3, 2016 Author Share Posted February 3, 2016 I did the same what bonus said, his problem is not that he cant see the chat. there is an error and im not good at debugging No matter just post what the error witch exist in debugscript on error /warning level , copy/past. Maybe show us the error? function playerChat(msg, msgtype) if msgtype == 0 then --then make a trigger end end addEventHandler("onPlayerChat", root, playerChat) /Debugscript 3/ Error error: Loading script failed: GPSoporte\Client.lua:225: ') expected (to close '('at time 218) near'" Link to comment
xRGamingx Posted February 3, 2016 Author Share Posted February 3, 2016 I did the same what bonus said, his problem is not that he cant see the chat. there is an error and im not good at debugging No matter just post what the error witch exist in debugscript on error /warning level , copy/past. Tabs = {} function createGUI() -------- CS_Window = guiCreateWindow(131,120,1004,484,"GP-Soporte",false) guiSetVisible(CS_Window,false) centerWindow(CS_Window) guiWindowSetMovable(CS_Window,false) guiWindowSetSizable(CS_Window,false) CS_TabPanel = guiCreateTabPanel(10,25,985,449,false,CS_Window) --------- if ( Rooms and type(Rooms) == "table" ) then for k,v in ipairs ( Rooms ) do local roomName = v local newTab = guiCreateTab(tostring(v),CS_TabPanel) -- Tabs[roomName] = {} Tabs[roomName]["Grid"] = guiCreateGridList(0,5,979,377,false,newTab) Tabs[roomName]["Column"] = guiGridListAddColumn(Tabs[roomName]["Grid"],"Date",0.1) Tabs[roomName]["Column"] = guiGridListAddColumn(Tabs[roomName]["Grid"],"Player" ,0.1) Tabs[roomName]["Column"] = guiGridListAddColumn(Tabs[roomName]["Grid"],"Messages",0.9) Tabs[roomName]["Edit"] = guiCreateEdit(0,382,889,41,"",false,newTab) Tabs[roomName]["Button1"] = guiCreateButton(889,382,90,39,"Send",false,newTab) -- manageButton(Tabs[roomName]["Button1"]) manageEdit(Tabs[roomName]["Edit"]) manageHelp(Tabs[roomName]["Button2"]) manageGrid(Tabs[roomName]["Grid"]) setUpToolTips(roomName) -- setElementData(localPlayer,"RG"..roomName,false) guiGridListSetSortingEnabled ( Tabs[roomName]["Grid"], false ) end end -- setUpBind() end addEventHandler("onClientResourceStart",resourceRoot,function () createGUI() fileDelete("Settings.lua") fileDelete("Client.lua") end ) function centerWindow(center_window) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(center_window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(center_window,x,y,false) end function manageButton(button) if not button then return end addEventHandler("onClientGUIClick",root,function() if source == button then onMsg() end end ) end function onMsg(withEdit,text) local tab = guiGetSelectedTab(CS_TabPanel) local tabName = guiGetText(tab) local edit = Tabs[tabName]["Edit"] if withEdit ~= false then editText = guiGetText(edit) else editText = text end if ( editText ~= "" ) then if not FloodOn == true then triggerServerEvent("onPlayerChatMessage",localPlayer,tabName,editText,Log) FloodOn = true guiSetText(edit,"") setTimer(function() FloodOn = false end , Flood , 1 ) end end end function check(key,press) if key == "enter" and press then if spec then onMsg() end end end function manageEdit(edit) addEventHandler("onClientGUIChanged",root,function() if source == edit then local text = guiGetText(edit) if text and text ~= "" then if not spec then spec = true addEventHandler("onClientKey",root,check ) end else if spec then spec = false removeEventHandler("onClientKey",root,check ) end end end end ) end addEvent("sendMessageToClient",true) addEventHandler("sendMessageToClient",root,function ( Sender , Room , Text, Text2,Text4,color1, color2, color3 ) if ( Room and Text ) then local grid = Tabs[Room]["Grid"] local row = guiGridListAddRow(grid) for id, player in ipairs(getElementsByType("player")) do guiGridListSetItemText ( grid , row , 1 , Text , false , false ) guiGridListSetItemText ( grid , row , 2 , Text2 , false , false ) guiGridListSetItemText ( grid , row , 3 , Text4 , false , false ) for i = 1, 4 do guiGridListSetItemColor(grid, row, i, color1, color2, color3) end end local vis = guiGetVisible(CS_Window) if vis == true and guiGetText(guiGetSelectedTab(CS_TabPanel)) == Room then end end end ) function setUpBind() bindKey(KeyToOpen or "F2","down", function () guiSetVisible(CS_Window,not guiGetVisible(CS_Window) ) showCursor(guiGetVisible(CS_Window)) if guiGetVisible(CS_Window) == true then mode = "no_binds_when_editing" else mode = "allow_binds" end guiSetInputMode(mode or "allow_binds") end ) --- if BindChat == true then function Command(Command,...) local text = table.concat({...}," ") if text then onMsg(false,text) end end addCommandHandler("soporte",Command) bindKey(theBind or "","down","chatbox","Soporte") end end function manageHelp(button) addEventHandler("onClientGUIClick",root,function() if source == button then guiSetVisible(Help_Win,true) guiBringToFront(Help_Win) function onDbl() if source == Help_Win or Help_Label1 or Help_Memo or HelpLable2 then removeEventHandler("onClientGUIDoubleClick",root,onDbl) -- guiSetVisible(Help_Win,false) end end addEventHandler("onClientGUIDoubleClick",root,onDbl) end end ) end function playerChat(msg, msgtype) if msgtype == 0 then --then make a trigger end end addEventHandler("onPlayerChat", root, playerChat) Link to comment
Bonus Posted February 3, 2016 Share Posted February 3, 2016 Well, wtf ... You even know how to script? You didnt even use my code ... also it has to be serversided, not clientsided. Link to comment
xRGamingx Posted February 3, 2016 Author Share Posted February 3, 2016 Well, wtf ...You even know how to script? You didnt even use my code ... also it has to be serversided, not clientsided. I step script for PM 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