Jump to content

chat output?


Recommended Posts

Posted

--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) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
--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

Posted

It is the same.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

-_-, are you going to tell to me that it is not? i'm learning since i was 14.

Post your code here.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Post your code here.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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) 

Posted

You didn't copy my server side code, you put send_text not text in outputChatBox, copy my SERVER SIDE CODE AGAIN.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Dude, it won't work because you put SendMemo and it was ChatMemo.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Better check twice before say the other did something wrong.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...