Author Topic: [SOLVED] What in the heck is wrong?  (Read 636 times)

I'm trying to make an admin script and for that I need this

package Package
{

    function GameConnection::onConnect(%this, %a, %b) // I'm not sure how many args
        {
            Parent::onConnect(%this, %a, %b);
        }

};

it gives me the error:
function declaration failed: GameConnection::onConnect

What am I doing wrong? All of the other GameConnection functions work fine like
GameConnection::onClientJoinGame() and
GameConnection::onConnectionAccepted()
« Last Edit: July 21, 2016, 10:11:57 PM by KozzyMoto »

I don't see anything wrong with that and I've never encountered that error before, so maybe you just aren't allowed to package it?

Why not use GameConnection::autoAdminCheck() instead?

I'll try that.
Thanks for the reply!

Erm, how exactly do I do that?

like this?

package Package
{

function GameConnection::checkAdmin(%this)
{

\\do stuff

}

};


or

package Package
{

function GameConnection::checkAdmin(%this)
{

\\do stuff

}

};

function checkAdmin(%client)
{

\\do stuff

}

like how would i do that


note that with autoAdminCheck, you have to return the parent, otherwise it breaks

here's an example
Code: [Select]
package bebebobo
{
   function GameConnection::autoAdminCheck(%this)
   {
      %r = parent::autoAdminCheck(%this);
      //do some magic things
      return %r;
   }
};
activatePackage(bebebobo);

package Package
{
   function GameConnection::checkAdmin(%this)
   {
      %ca = parent::checkAdmin(%this);
      //do stuff
      return %ca;
   }
};

and it does nothing

package Package
{
   function GameConnection::checkAdmin(%this)
   {
      %ca = parent::checkAdmin(%this);
      //do stuff
      return %ca;
   }
};

and it does nothing
no
GameConnection::autoAdminCheck(%this)
not ::checkAdmin.