Author Topic: Check ID then kick  (Read 1419 times)


Um, why doesn't it just ban them before they enter the server?


I never said it wouldn't. I just need to know this so I can branch off.

If you mean what I think you mean...
Here is how I would do it:
Code: [Select]
package IDCheck
{
   function GameConnection::autoAdminCheck(%client)
   {
      %ID = %client.bl_id;
      if(isBlockedID(%ID))
      {
         %client.delete("Blocked ID");
      }
      Parent::autoAdminCheck(%client);
   }
};
function isBlockedID(%ID)
{
   if(%ID $= "idhere" || %ID $= "idhere") //etc...
   {
      return 1;
   }
   else
   {
      return 0;
   }
}
activatePackage(IDCheck);

Code: [Select]
function GameConnection::onClientEnterGame(%this)
{
   if(%this.BL_ID$=7612){
       %client.delete("bant");
    }
   else{
    return;
   }
Parent::onClientEnterGame(%this);
}


FUUUUUUUU

Code: [Select]
function GameConnection::onClientEnterGame(%this)
{
   if(%this.BL_ID$=7612){
       %client.delete("bant");
    }
   else{
    return;
   }
Parent::onClientEnterGame(%this);
}


FUUUUUUUU
No. That happens when they spawn. Hurr.

If you mean what I think you mean...
Here is how I would do it:
Code: [Select]
package IDCheck
{
   function GameConnection::autoAdminCheck(%client)
   {
      %ID = %client.bl_id;
      if(isBlockedID(%ID))
      {
         %client.delete("Blocked ID");
      }
      Parent::autoAdminCheck(%client);
   }
};
function isBlockedID(%ID)
{
   if(%ID $= "idhere" || %ID $= "idhere") //etc...
   {
      return 1;
   }
   else
   {
      return 0;
   }
}
activatePackage(IDCheck);

I'd recommend doing that like this:

Code: [Select]
package IDCheck
{
function GameConnection::autoAdminCheck(%this)
{
if($BlockedID[%this.bl_id])
%this.schedule(0,delete,"\nYou are blocked!");
else
return Parent::autoAdminCheck(%this);
}
};
activatePackage(IDCheck);

Then either before that, after that, or even in another file altogether, you can define things like $BlockedID[666] = 1; and $BlockID[1337] = 1; (each on their own line, preferably).

I'd recommend doing that like this:

Code: [Select]
package IDCheck
{
function GameConnection::autoAdminCheck(%this)
{
if($BlockedID[%this.bl_id])
%this.schedule(0,delete,"\nYou are blocked!");
else
return Parent::autoAdminCheck(%this);
}
};
activatePackage(IDCheck);

Then either before that, after that, or even in another file altogether, you can define things like $BlockedID[666] = 1; and $BlockID[1337] = 1; (each on their own line, preferably).
So it will ban everyone with a $BlockedId

So it will ban everyone with a $BlockedId

No, it will simply bar their ability to join the server. I was just giving Lilboarder an improvement suggestion.

No, it will simply bar their ability to join the server. I was just giving Lilboarder an improvement suggestion.
K, thanks, yours is way more efficient.

Here's a better idea.
Instead of filling up the script file with a bunch of $BlockedID[bla bla bla] = 1;
then having some functions in there.
Do this in the script:
BanBLID(id,-1,"Reason");

Here's a better idea.
Instead of filling up the script file with a bunch of $BlockedID[bla bla bla] = 1;
then having some functions in there.
Do this in the script:
BanBLID(id,-1,"Reason");

I wasn't referring to what Heed was talking about; I already stated this:

No, it will simply bar their ability to join the server. I was just giving Lilboarder an improvement suggestion.

Obviously, if you want to ban someone, you'd just do it without a script, but:

I just need to know this so I can branch off.

Obviously, if you want to ban someone, you'd just do it without a script, but:
That's the issue with spoonfeeding. They can't start something to branch off on their own.
It's not hard to look at some other mods that do something as soon as someone connects. For example, reserved slots. It even gets the BL_ID of the client.

That's the issue with spoonfeeding. They can't start something to branch off on their own.
It's not hard to look at some other mods that do something as soon as someone connects. For example, reserved slots. It even gets the BL_ID of the client.

Reserved slots is silly though; you should have used onConnectRequest.

Regardless it's a perfect example.