The first thing you need to fix is the terribly inconsistent styling.
Also, you should just use PHP tags for code that's not too long to post.
PHP Code:
function onActionServerSide( cmd )
{
if ( cmd == "getLogtext" )
{
temp.l.loadLines( "logs/systemmass.txt" );
triggerclient( "gui", name, "returnLogtext", temp.l );
}
}
//#CLIENTSIDE
function onCreated()
{
triggerserver( "gui", name, "getLogtext" );
}
function showMessage( news )
{
new GuiWindowCtrl("LogReader_Window")
{
profile = GuiBlueWindowProfile;
clientrelative = true;
clientextent = "589,516";
isexternal = false;
canclose = true;
canmaximize = false;
canmove = true;
canresize = false;
closequery = false;
destroyonhide = false;
text = "Log Reader";
x = 370;
y = 72;
new GuiScrollCtrl("LogReader_MultiLine_Scroll")
{
profile = GuiBlueScrollProfile;
height = 504;
hscrollbar = "dynamic";
vscrollbar = "dynamic";
width = 576;
x = 6;
y = 7;
new GuiMLTextCtrl("LogReader_MultiLine")
{
profile = GuiBlueMLTextProfile;
height = 17;
horizsizing = "width";
plaintext = "";
text = news;
width = 551;
}
}
}
}
function onPlayerChats()
{
if (player.chat == "/showlog")
{
if(!(LogReader_Window.visible))
{
LogReader_Window.visible = true;
player.chat = "";
}
}
if (player.chat == "/hidelog")
{
if (LogReader_Window.visible)
{
LogReader_Window.visible = false;
player.chat = "";
}
}
}
function onActionClientSide( cmd, l )
{
if ( cmd == "returnLogtext" )
{
for ( temp.a : l )
{
temp.ne @= temp.a @ "\n";
}
showMessage( temp.ne );
}
setimer(0.05);
}
function onWeaponFired()
{
triggerserver( "gui", name, "getLogtext" );
}
Cleaned up a bit:
PHP Code:
function onActionServerSide(cmd) {
if (cmd == "getLogtext") {
temp.l.loadLines("logs/systemmass.txt");
triggerclient("gui", name, "returnLogtext", temp.l);
}
}
//#CLIENTSIDE
function onCreated() {
triggerserver("gui", name, "getLogtext");
}
function showMessage(news) {
new GuiWindowCtrl("LogReader_Window") {
profile = GuiBlueWindowProfile;
clientrelative = true;
clientextent = "589,516";
isexternal = false;
canclose = true;
canmaximize = false;
canmove = true;
canresize = false;
closequery = false;
destroyonhide = false;
text = "Log Reader";
x = 370;
y = 72;
new GuiScrollCtrl("LogReader_MultiLine_Scroll") {
profile = GuiBlueScrollProfile;
height = 504;
hscrollbar = "dynamic";
vscrollbar = "dynamic";
width = 576;
x = 6;
y = 7;
new GuiMLTextCtrl("LogReader_MultiLine") {
profile = GuiBlueMLTextProfile;
height = 17;
horizsizing = "width";
plaintext = "";
text = news;
width = 551;
}
}
}
}
function onPlayerChats() {
if (player.chat == "/showlog") {
if (!(LogReader_Window.visible)) {
LogReader_Window.visible = true;
player.chat = "";
}
}
if (player.chat == "/hidelog") {
if (LogReader_Window.visible) {
LogReader_Window.visible = false;
player.chat = "";
}
}
}
function onActionClientSide(cmd, l) {
if (cmd == "returnLogtext") {
for (temp.a: l) {
temp.ne @= temp.a @ "\n";
}
showMessage(temp.ne);
}
setimer(0.05);
}
function onWeaponFired() {
triggerserver("gui", name, "getLogtext");
}
What's with the (misspelled)
setTimer command in
onActionClientSide?