TonyJunakPRO Posted April 3, 2011 Posted April 3, 2011 script for outputing on chatbox(outbut needs to be visible for everyone) output looks like this: [PlayerName:] [text what is on Edit1] so how to do this
Castillo Posted April 3, 2011 Posted April 3, 2011 --client side text = guiGetText(myGUIEdit) triggerServerEvent("send_text",getLocalPlayer(),text) --server side addEvent("send_text",true) addEventHandler("send_text",getRootElement(), function (text) outputChatBox(getPlayerName(source) ..": ".. tostring(text),getRootElement(),255,0,0) end)
TonyJunakPRO Posted April 3, 2011 Author Posted April 3, 2011 --client side text = guiGetText(myGUIEdit) triggerServerEvent("send_text",getLocalPlayer(),text) --server side addEvent("send_text",true) addEventHandler("send_text",getRootElement(), function (text) outputChatBox(getPlayerName(source) ..": ".. tostring(text),getRootElement(),255,0,0) end) thanks
TonyJunakPRO Posted April 3, 2011 Author Posted April 3, 2011 It is the same. no it isnt, it writes on chatbox: TonyJunak: false
Castillo Posted April 3, 2011 Posted April 3, 2011 , are you going to tell to me that it is not? i'm learning since i was 14. Post your code here.
TonyJunakPRO Posted April 3, 2011 Author Posted April 3, 2011 but it writes me on chatbox: TonyJunak: false whatever i say it writes: TonyJunak: false
TonyJunakPRO Posted April 3, 2011 Author Posted April 3, 2011 i used code what you gave me, but whatever: full client: ScreenLocked = guiCreateWindow(22,175,141,267,"SmartEX C45",false) guiWindowSetMovable(ScreenLocked,false) guiWindowSetSizable(ScreenLocked,false) ImageLocked = guiCreateStaticImage(9,30,123,228,"images/ScreenLocked.jpg",false,ScreenLocked) ScreenLocked_UnlockImage = guiCreateStaticImage(32,122,59,61,"images/unlock.png",false,ImageLocked) ScreenLocked_UnlockButton = guiCreateButton(5,194,110,19,"Press to Unlock",false,ImageLocked) guiSetVisible(ScreenLocked, false) ScreenMenu = guiCreateWindow(22,175,141,267,"SmartEX C45",false) guiWindowSetMovable(ScreenMenu,false) guiWindowSetSizable(ScreenMenu,false) ImageMenu = guiCreateStaticImage(9,30,123,228,"images/ScreenLocked.jpg",false,ScreenMenu) ChatButton = guiCreateButton(13,38,111,22,"Chat",false,ScreenMenu) PhotosButton = guiCreateButton(13,64,111,22,"Photos",false,ScreenMenu) MusicButton = guiCreateButton(13,89,111,22,"Music",false,ScreenMenu) MusicButton = guiCreateButton(13,114,111,22,"Internet",false,ScreenMenu) guiSetVisible(ScreenMenu, false) ScreenChat = guiCreateWindow(22,175,141,267,"SmartEX C45",false) guiWindowSetMovable(ScreenChat,false) guiWindowSetSizable(ScreenChat,false) ImageChat = guiCreateStaticImage(9,30,123,228,"images/ScreenLocked.jpg",false,ScreenChat) ChatMemo = guiCreateMemo(16,39,109,150,"",false,ScreenChat) ChatSend = guiCreateButton(83,194,40,20,"Send",false,ScreenChat) ChatBack = guiCreateButton(15,233,40,20,"Back",false,ScreenChat) guiSetVisible(ScreenChat, false) function showHide() if guiGetVisible(ScreenLocked)==true then showCursor(false) guiSetVisible(ScreenLocked, false) else showCursor(true) guiSetVisible(ScreenLocked, true) if guiGetVisible(ScreenMenu)==true then showCursor(false) guiSetVisible(ScreenLocked, false) guiSetVisible(ScreenMenu, false) end if guiGetVisible(ScreenChat)==true then showCursor(false) guiSetVisible(ScreenLocked, false) guiSetVisible(ScreenChat, false) end end end bindKey ("f1", "down", showHide) function funScreenLocked_UnlockButton() guiSetVisible(ScreenMenu, true) guiSetVisible(ScreenLocked, false) end addEventHandler ( "onClientGUIClick", ScreenLocked_UnlockButton, funScreenLocked_UnlockButton, false ) addEventHandler ( "onClientGUIClick", ScreenLocked_UnlockImage, funScreenLocked_UnlockButton, false ) function funChatButton() guiSetVisible(ScreenChat, true) guiSetVisible(ScreenMenu, false) end addEventHandler ( "onClientGUIClick", ChatButton, funChatButton, false ) function funChatSend() text = guiGetText(SendMemo) triggerServerEvent("send_text",getLocalPlayer(),text) end addEventHandler ( "onClientGUIClick", ChatSend, funChatSend, false ) function funChatBack() guiSetVisible(ScreenMenu, true) guiSetVisible(ScreenChat, false) end addEventHandler ( "onClientGUIClick", ChatBack, funChatBack, false ) full server: addEvent("send_text",true) addEventHandler("text",getRootElement(), function (text) outputChatBox(getPlayerName(source) ..": ".. tostring(send_text),getRootElement(),255,0,0) end)
Castillo Posted April 3, 2011 Posted April 3, 2011 You didn't copy my server side code, you put send_text not text in outputChatBox, copy my SERVER SIDE CODE AGAIN.
TonyJunakPRO Posted April 3, 2011 Author Posted April 3, 2011 i copyied it and it writes TonyJunak: nil
Castillo Posted April 3, 2011 Posted April 3, 2011 Dude, it won't work because you put SendMemo and it was ChatMemo.
Castillo Posted April 3, 2011 Posted April 3, 2011 Better check twice before say the other did something wrong.
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