Author Topic: Error with messageall  (Read 1609 times)

Code: [Select]
package NameCheckRequest
{
    function GameConnection::onConnectRequest(%this, %addr, %lan, %name, %pre, %suf, %rtb)
  {
Parent::onConnectRequest
messageAll('', '<color:FFFFFF>Connection request from:<color:FFFF00>' SPC %client.getAddress());
  }
};
activatepackage(NameCheckRequest);

package NameCheckSuccess
{
function GameConnection::onConnect( %client, %name )
  {
Parent::OnConnect
messageAllExcept(%client, -1, '', '\c1%1 has connected with an IP Adress from' SPC %client.getAddress() SPC'.', %client.name, %client));
messageClient('', "<color:FFFFFF>Your ping is<color:FF00FF>" SPC %client.getPing()"MS<color:FFFFFF>.");
  }
};
activatepackage(NameCheckSuccess);

Somehow, there is a tiny error, here it is:
package NameCheckRequest
{
    function GameConnection::onConnectRequest(%this, %addr, %lan, %name, %pre, %suf, %rtb)
  {
   Parent::onConnectRequest
   messageAll(#'#', '<color:FFFFFF>Connection request from:<color:FFFF00>' SPC %client.getAddress());
  }
};

How can I fix that?

For freetext use " not '

Like so
messageAll('',"Hey there!");

Haha edit;

It's also because you don't have the ";" after your parent

I have already tried that and I still have that same error.

I have already tried that and I still have that same error.
Read my edit.

Also the whole " over ' thing,

" is freetext
' indicates a tagged string

Code: [Select]
package NameCheckRequest

{

    function GameConnection::onConnectRequest(%this, %addr, %lan, %name, %pre, %suf, %rtb)

  {

^Parent::onConnectRequest;##
##
^messageAll('', "<color:FFFFFF>Connection request from:<color:FFFF00>" SPC %client.getAddress());

  }

};

activatepackage(NameCheckRequest);

Now there is a new error

Code: [Select]
package NameCheckRequest

{

    function GameConnection::onConnectRequest(%this, %addr, %lan, %name, %pre, %suf, %rtb)

  {

^Parent::onConnectRequest;##
##
^messageAll('', "<color:FFFFFF>Connection request from:<color:FFFF00>" SPC %client.getAddress());

  }

};

activatepackage(NameCheckRequest);

Now there is a new error
Theres so many errors ;-;
Your functions don't even have arguments
And you don't need two packages, I'm assuming

Wow, is this even possible? >.< Well, I guess I will try to scramble the code a little....

EDIT: I guess I will try to scramble the code a little....

Code: [Select]
package NameCheck
{
    function GameConnection::onConnectRequest(%this, %addr, %lan, %name, %pre, %suf, %rtb)
  {
Parent::onConnectRequest(%this, %addr, %lan, %name, %pre, %suf, %rtb);
messageAll('', '<color:FFFFFF>Connection request from:<color:FFFF00>' SPC %client.getAddress());

function GameConnection::onConnect(%client, %name)
  {
Parent::OnConnect(%client, %name);
messageAllExcept(%client, -1, '', '\c1%1 has connected with an IP Adress from' SPC %client.getAddress() SPC'.', %client.name, %client));
messageClient('', "<color:FFFFFF>Your ping is<color:FF00FF>" SPC %client.getPing()"MS<color:FFFFFF>.");
  }
};
activatepackage(NameCheck);

Try that

Another error >.<

Code: [Select]
package NameCheck
{
    function GameConnection::onConnectRequest(%this, %addr, %lan, %name, %pre, %suf, %rtb)
  {
Parent::onConnectRequest(%this, %addr, %lan, %name, %pre, %suf, %rtb);
messageAll('', "<color:FFFFFF>Connection request from:<color:FFFF00>" SPC %client.getAddress());

function #G#ameConnection::onConnect(%client, %name)
  {
Parent::OnConnect(%client, %name);
messageAllExcept(%client, -1, '', "\c1%1 has connected with an IP Adress from" SPC %client.getAddress() SPC".", %client.name, %client));
messageClient('', "<color:FFFFFF>Your ping is<color:FF00FF>" SPC %client.getPing()"MS<color:FFFFFF>.");
  }
};
activatepackage(NameCheck);
« Last Edit: November 06, 2012, 09:21:46 PM by Advanced Bot »

Code: [Select]
package NameCheck
{
    function GameConnection::onConnectRequest(%this, %addr, %lan, %name, %pre, %suf, %rtb)
  {
Parent::onConnectRequest(%this, %addr, %lan, %name, %pre, %suf, %rtb);
messageAll('', "<color:FFFFFF>Connection request from:<color:FFFF00>" SPC %client.getAddress());
   }

function GameConnection::onConnect(%client, %name)
  {
Parent::OnConnect(%client, %name);
messageAllExcept(%client, -1, '', "\c1%1 has connected with an IP Adress from" SPC %client.getAddress() SPC".", %client.name, %client));
messageClient('', "<color:FFFFFF>Your ping is<color:FF00FF>" SPC %client.getPing()"MS<color:FFFFFF>.");
  }
};
activatepackage(NameCheck);
Try that

cause there's a missing }

Try that
proofread your code please

cause there's a missing }
proofread your code please
I'm sorry, I didn't know he didn't understand how to use a function

I can understand a function. I new there was a missing bracket. I added it before you posted a new code. But now there is a new error. This is getting annoying lol

Code: [Select]
package NameChecker
{
    function GameConnection::onConnectRequest(%this, %addr, %lan, %name, %pre, %suf, %rtb)
  {
Parent::onConnectRequest(%this, %addr, %lan, %name, %pre, %suf, %rtb);
messageAll('', "<color:FFFFFF>Connection request from:<color:FFFF00>" SPC %client.getAddress());
  }

function GameConnection::onConnect(%client, %name)
  {
Parent::OnConnect(%client, %name);
messageAllExcept(%client, -1, '', "\c1%1 has connected with an IP Adress from" SPC %client.getAddress() SPC".", %client.name, %client))##;##
messageClient('', "<color:FFFFFF>Your ping is<color:FF00FF>" SPC %client.getPing()"MS<color:FFFFFF>.");
  }
};
activatepackage(NameChecker);

Code: [Select]
[quote author=Advanced Bot link=topic=213319.msg6021607#msg6021607 date=1352255392]

messageAllExcept(%client, -1, '', "\c1%1 has connected with an IP Adress from" SPC %client.getAddress() SPC".", %client.name, %client))##;##
activatepackage(NameChecker);

Look at how many closing parentheses there are.


Code: [Select]
messageAllExcept(%client, -1, '', "\c1%1 has connected with an IP Adress from" SPC %client.getAddress() SPC".", %client.name, %client))##;##

You have an extra parenthesis there, also why do you have %client.name and %client at the end?