Blockland Forums > Modification Help
Announcement
(1/11) > >>
Jookia:
I can't enter two words when I type "/announce Testing Today" in the chat box, it just returns as "Announcement: Testing". Here's the code from my my serverCMDAnnounce.


--- Code: --- if(strlen(%text) <= 1)
{
return;
}

%obj = %client.player;
%obj.playthread(0, talk); //fwar play talk animation
%obj.schedule(strlen(%text) * 50, stopthread, 0);
   
    if(strlen(%text) >= $Pref::Server::MaxChatLen)
{
%text = getSubStr(%text, 0, $Pref::Server::MaxChatLen);
}

chatMessageAll(%client, '\c3Announcement: \c0%1', %text);
echo("Announcement: ", %text);

--- End code ---
Ephialtes:
chatMessageAll(%client, '\c3Announcement: \c0%1', %text);

should be

messageAll('','\c3Announcement: \c0%1', %text);
Jookia:
It still only displays one word.
Ephialtes:
Post the whole function.
Jookia:
function serverCmdAnnounce(%client, %text)
{
   if (%client.issuperadmin || %client.isadmin)
   {
      %text = StripMLControlChars(%text);

      if(strlen(%text) <= 1)
      {
         return;
      }

      %obj = %client.player;
      %obj.playthread(0, talk);            //fwar play talk animation
      %obj.schedule(strlen(%text) * 50, stopthread, 0);
   
         if(strlen(%text) >= $Pref::Server::MaxChatLen)
      {
         %text = getSubStr(%text, 0, $Pref::Server::MaxChatLen);
      }

      messageAll('','\c3Announcement: \c0%1', %text);
      echo("Announcement: ", %text);
   }
   else
   {
      return;
   }

}
Navigation
Message Index
Next page

Go to full version