Kicking and banning function errors
by Jookia · in Torque Game Engine · 04/18/2007 (12:34 am) · 2 replies
Torque chucks an ESP or something hissy fit when I do one of these commands:
function serverCmdKick(%client, %victim)
{
if(%client.isAdmin || %client.isSuperAdmin)
{
//kill the victim client
if (!%victim.isAIControlled())
{
%ip = getRawIP(%victim);
if(%ip !$= "local")
{
//tell everyone about it
messageAll( 'MsgAdminForce', '\c2The Admin has kicked %1 (%2).', %victim.name, getRawIP(%victim));
//kick them
%victim.delete("You have been kicked by " @ %client.name @ ".");
}
else
{
messageClient(%client, 'MsgAdminForce', '\c2You can\'t kick the local client.');
return;
}
}
else
{
//always kick bots
%victim.delete("You have been kicked by " @ %client.name @ ".");
}
}
}
function serverCmdBan(%client, %victim)
{
if(%client.isAdmin || %client.isSuperAdmin)
{
//add player to ban list
if (!%victim.isAIControlled())
{
//this isnt a bot so add their ip to the banlist
%ip = getRawIP(%victim);
if(%ip !$= "local")
{
//tell everyone about it
messageAll( 'MsgAdminForce', '\c2The Admin has banned %1 (%2).', %victim.name, getRawIP(%victim));
$Ban::numBans++;
$Ban::ip[$Ban::numBans] = %ip;
}
else
{
messageClient(%client, 'MsgAdminForce', '\c2You can\'t ban the local client.');
return;
}
}
//kill the victim client
%victim.delete("You have been banned by " @ %client.name @ ".");
}
}About the author
#2
04/18/2007 (2:51 pm)
I dunno what it is. It crashes the game, but not end task, it comes up with something 'bout ESP and abort, retry and ignore.
Torque Owner Stefan Lundmark
I suppose it crashes? Try commenting out parts until it works again. Could be the IP stuff.