![]() |
Custom Chat System
Come on guys, you know the good old online rpg games!
anyway basically iv got a script where when the player chats it shows all players chat in a window. the only problem is it only will show one players chat then when another player chats it disappears. how would i make this so when you chat it shows it and when someone else chats your chat gets pushed up and theirs goes where yours was? PHP Code:
|
you are redefining the PlayerChat GUI constantly and not even placing it within your original GUI. You should also be using a GuiMLTextCtrl, for multiple lines of chat. Quick example, not tested.
PHP Code:
|
The above example looks right except for one thing.
PHP Code:
PHP Code:
|
Quote:
Probably want to append it to the end rather than the beginning so you don't create a blank line right away. |
wow a new gui i didnt even know about lol.. i havnt been able to test around with your example and tweak it yet seeming im not at home. id there any way to make a scroll bar which wiuld allow you to view previous text?
thanks guys for your help. id be stuck without it! :D As you guys can probably tell im extremly new to scripting. iv only been scripting for about two months now. im also trying to learn javascript which iv noticed is extremly simmilar. would this benefit my scripting ability on graal in any way shape or form? thanks again. |
Quote:
PHP Code:
Quote:
|
Quote:
|
writing Guiname.addtext(player.nick@": "@player.chat); doesnt work..
any ideas? |
Quote:
|
Quote:
|
iv finally got all that working correctly. now to get the add text right its not working.
it now displays the message to all players. once u chat it sets server.temp.chat to ur chat and server.temp.nick to your nick and then adds the chat but on the add chat because its clientside its not reading server.temp.nick or server.temp.chat.. any suggestions? im completly stuck, almost to the point of pulling my hair out. |
this is not the approach you should be using at all
|
Quote:
Second, Quote:
|
Why are there three threads for this chat system?
|
Correction Two.
One is just because i was getting confused about flags. also if i dont store it serverside it will only display it clientside. if you would like to show me how i can no store it server side and still have it display correctly your more than welcome to. |
Quote:
|
i really dont understand mark sir links first one, the whole idea confuses me.
can someone explain exactly what each bit does so im not so confused? mainly the onremoteplayerchats is that rc chatter? also the temp. stuff confuses me :$ |
the temp.pl doesnt make sense of what i understand, wouldnt you need to put for( pl = allplayers) or somthing? or am i misunderstanding the whole concept of it?
|
The temp.pl thing you are describing is most likely a loop, declared as such:
PHP Code:
On the clientside, it will loop through all the players on the server and irc channels. On the serverside, it will just loop through all the players on the server. How it works is that each player it loops through will become the object (temp.pl), and you can read many different things such as .account, .x, .y, etc of that player. Things like: PHP Code:
PHP Code:
|
Quote:
|
the temp.pl in my original post refers to the object parameter thrown in
PHP Code:
addChat was then added with two parameters, both strings, to indicate the sender's nickname, and sender's text. That function was created to avoid having to copy and paste virtually the same execution within both functions, and can be made public so it can be called elsewhere should you want to add messages from the server or something. |
| All times are GMT +2. The time now is 03:13 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.