Blockland Forums > Modification Help
NewMesageHud?
(1/1)
Jookia:
NMH::addLine doesn't work...?
rudyman:
NMH_Type is the Message Hud, the text box you type in to send messages.

It would be way better just to use messageClient() or messageAll() to do this, but....

If you just want to know how to add a line to the new chat hud, use this:

--- Code: ---function displayLatest()
{
%obj=MissionCleanup.getObject(2);
NewChatSO::displayLatest(%obj);
}
function newChatText::addLine(%this,%text)
{
%this.addText("\n"@%text,1);
schedule(4000,0,displayLatest);
}

--- End code ---

This uses newChatText.addLine("TEXT HERE");
-=>RR<=-MasterCE:

--- Code: ---function NMH_Type::send(%this) {
%text = cleanStringemot(trim(%this.getValue()));
if(strstr(strlwr(%text),"/") == 0) {
  %text = getSubStr(%text,1,strlen(%text));
  %command = getword(%text,0);
  if(getwordcount(%text)>=2) {
    %vars = getwords(%text,1,getwordcount(%text));
    %vars = getsubstr(%vars,0,strlen(%vars)-1);
eval("commandtoserver(\'"@%command@"\',\"" @ %vars @ "\");");
//echo("commandtoserver(\'"@%command@"\',\"" @ %vars @ "\");");
  }
  else {
    eval("commandtoserver(\'"@%command@"\');");
    //echo("commandtoserver(\'"@%command@"\');");
  }
  canvas.popdialog(NewMessageHud);
  return;
}
else if(%text !$= "") {
  if(NewMessageHud.isTeamMsg)
commandToServer('teamMessageSent',%text);
  else if(NewMessageHud.isLocalMsg)
commandToServer('localMessageSent',%text);
  else
commandToServer('messageSent',%text);
}
canvas.popdialog(NewMessageHud);
//activateKeyboard();
}
--- End code ---
And I'll try your script there, rudy. Since you don't have Retail, it may not work, since you can't check. I'm not saying you can't script btw.
Navigation
Message Index

Go to full version