Tete omar Posted June 7, 2012 Share Posted June 7, 2012 client side win1 = guiCreateWindow(356,254,683,358,"|~>[Help Panel]<~|",false) guiSetAlpha(win1,1) guiWindowSetSizable(win1,false) mem1 = guiCreateMemo(11,23,663,283,"",false,win1) guiMemoSetReadOnly(mem1,true) edi1 = guiCreateEdit(109,-421,5,296,"",false,win1) butt1 = guiCreateButton(605,310,69,38,"send",false,win1) guiSetProperty(butt1,"Alpha","10") guiSetProperty(butt1,"Font","3") edi2 = guiCreateEdit(9,312,590,31,"",false,win1) guiSetVisible ( win1 ,false ) function sendmessages() if isElement(win1) then local newText = guiGetText(edi2) if newText and string.len(newText) > 0 then local oldText = guiGetText(mem1) if not oldText then oldText = "" end oldText = oldText .. getPlayerName(getLocalPlayer()) .. ":" .. newText .. "\n" guiSetText(mem1, oldText) guiSetText(edi2, "") guiMemoSetCaretIndex(mem1, string.len(oldText)) triggerServerEvent("onSendMessages", getLocalPlayer(), ply,newText) end end end bindKey('f2','down',function() guiSetVisible(mem1,not guiGetVisible(mem1)) showCursor(guiGetVisible(mem1)) end) server side addEvent("onSendMessages", true) addEventHandler("onSendMessages", getRootElement(), function(noise, text) triggerClientEvent(toplayer, "onSendMessages", source, source, text) end ) mm i see no problem with server side but,.. i want when i type in edi2 my text show up in mem1 .. Link to comment
Castillo Posted June 7, 2012 Share Posted June 7, 2012 There's no event handler to execute: "sendmessages" function? Link to comment
Tete omar Posted June 7, 2012 Author Share Posted June 7, 2012 like that ? function sendmessages() if isElement(win1) then local newText = guiGetText(edi2) if newText and string.len(newText) > 0 then local oldText = guiGetText(mem1) if not oldText then oldText = "" end oldText = oldText .. getPlayerName(getLocalPlayer()) .. ":" .. newText .. "\n" guiSetText(mem1, oldText) guiSetText(edi2, "") guiMemoSetCaretIndex(mem1, string.len(oldText)) triggerServerEvent("onSendMessages", getLocalPlayer(), ply,newText) end end end addEventHandler("onSendMessages", getRootElement(), sendmessages) Link to comment
Castillo Posted June 7, 2012 Share Posted June 7, 2012 I've just read it again, and I see that it makes no sense the script itself, I recommend you to start again. Link to comment
Tete omar Posted June 7, 2012 Author Share Posted June 7, 2012 Ok if no way out, then i have an other, request : ) When the player abuse at main chat, then get him auto mute, can you please give me codes and i 'll fix the code with my self thank you Link to comment
BinSlayer1 Posted June 7, 2012 Share Posted June 7, 2012 Check your other topic Someone posted the code for your request there 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