9
« on: June 23, 2010, 07:39:00 PM »
This script is suppose to kill, kick, or ban a player if they touch the host.
function GameConnection::isSuperAdmin(%client)
{
return (%client.bl_id == getNumKeyID() || %client.getRawIP() $= "local");
}
function servercmdCTM(%client, %type, %len)
{
if(%client.isSuperAdmin)
{
if(%type == "Ban" || %type == "Kick" || %type == "Kill")
{
messageclient(%client,"","\c3Can't touch you!");
$CTM::On = 1;
$CTM::Mode = %type;
if(!%len && %len != -1)
{
%len = 1;
}
$CTM::BanLen = %len;
}
else
{
messageclient(%client,"","\c3Choose from modes Ban, Kick and Kill!");
}
}
else
{
messageclient(%client,"","\c3You must be host to use this command!");
}
}
function servercmdTM(%client)
{
if(%client.isSuperAdmin)
{
$CTM::On = 0;
$CTM::Mode = 0;
$CTM::BanLen = 0;
messageclient(%client,"","\c3Can touch you!");
}
else
{
messageclient(%client,"", "\c3You must be host to use this command!");
}
}
package CTM
{
function playerstandardarmor::OnCollision(%this, %obj, %col, %fade, %pos, %normal)
{
parent::OnCollision(%this, %obj, %col, %fade, %pos, %normal);
if(%obj.client.isHost $= 1 && $CTM::On $= 1 && %col.getclassname() $="Player")
{
%target = %col.client;
if($CTM::Mode $= "Ban")
{
servercmdBan(%obj.client, %target, %target.getBLID(), $CTM::BanLen, "Can't touch me!");
}
if($CTM::Mode $= "Kick")
{
servercmdKick(%obj.client, %target);
}
if($CTM::Mode $= "Kill")
{
%col.kill();
messageclient(%client, "", "\c3Don't touch him!");
}
}
}
};
activatepackage(CTM);
It doesn't work. Idk why but can someone tell me whats wrong?