PHP Code:
//#CLIENTSIDE
function onPlayerChats()
{
temp.fontSize = TradeChatList.profile.fontsize;
temp.fontType = TradeChatList.profile.fonttype;
temp.fontWidth = getTextWidth(temp.fontSize, temp.fontType, NULL, player.chat);
if(temp.fontWidth>5850)
{
TradeChatListText.text @= "<br>Your chat message is too long, please make it shorter.";
player.chat = "";
} else {
TradeChatListText.text @= "<br>" @ player.account @ ": " @ player.chat;
player.chat = "";
}
sleep(0.01);
TradeChatList.scrolltoBottom();
}
function onCreated()
{
new GuiScrollCtrl("TradeChatList")
{
profile = GuiBlueScrollProfile;
profile.border = 4;
position = { 6 , 233 };
width = 330;
height = 60;
hScrollBar = "dynamic";
vScrollBar = "alwaysOn";
new GuiMLTextCtrl("TradeChatListText")
{
profile = GuiBlueMLTextProfile;
position = { 4 , 0 };
width = 300;
height = 10;
text = "Trade Initialized with players: " @ player.account @ " and " @ client.TradePlayer @ ".";
}
}
}
It will go up.. then in 0.01 seconds, go down because of scrolltoBottom().