Prefer the Kakan is simpler than this
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menufunction onPlayerSpawn()
{
if (player.Ping >= the amount you want )
{
Message("Auto-Kicked:[ " + player.Name + " ] Reason:[ Execeeded ping 750ms ]");
player.Kick();
}
}
Function Tables ();
{
QuerySQL( db, "CREATE TABLE IF NOT EXISTS Alias ( IP TEXT, Nicks TEXT )" );
}
function onPlayerJoin( player )
{
AddAlias( player );
}
function AddAlias( player )
{
local a, subnet, q, data, newdata, found = false, i = 1;
a=split(player.IP,".");
subnet=a[0]+"."+a[1];
q = QuerySQL( db, "SELECT Nicks FROM Alias WHERE IP='" + subnet + "'" );
data = GetSQLColumnData( q, 0 );
if ( !data ) QuerySQL( db, "INSERT INTO Alias VALUES('" + subnet + "', '" + player.Name + "')" );
else{
while ( GetTok( data, " - ", i ) )
{
if ( GetTok( data, " - ", i ) == player.Name ) found = true; break;
i++;
}
newdata = data +" - "+ player.Name;
if ( !found ) QuerySQL( db, "UPDATE Alias SET Nicks='" + newdata + "' WHERE IP='" + subnet + "'" );
}
FreeSQLQuery( q );
}
function GetAlias( IP )
{
local a, subnet, q, data;
a=split(IP,".");
subnet=a[0]+"."+a[1];
q = QuerySQL( db, "SELECT Nicks FROM Alias WHERE IP='" + subnet + "'" );
data = GetSQLColumnData( q, 0 );
if ( data ) return data;
else return "None";
}
function onPlayerCommand( player, cmd, text )
{
else if ( cmd == "alias" )
{
if ( stats[ player.ID ].Level < 3 ) MessagePlayer( "Error - You don't have access to it.", player);
else if ( !text ) MessagePlayer( "Syntax: /alias <player>", player);
else
{
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer( "Error - Unknown player.", player);
else MessagePlayer( "" + plr.Name + "(" + plr.IP + ")'s aliases: " + GetAlias( plr.IP ) + ".", player );
}
}
else if ( cmd == "salias" )
{
if ( stats[ player.ID ].Level < 3 ) MessagePlayer( "Error - You don't have access to it.", player);
else if ( !text ) MessagePlayer( "Syntax: /salias <subnet>", player);
else
{
local ip = split(text, "."), length = NumTok(text, ".").tointeger();
if ( length < 2 ) PrivMessage( player, "Invalid IP" );
else if (!IsNum( ip[0] )) MessagePlayer( "Error - Unknown IP.", player);
else if (!IsNum( ip[1] )) MessagePlayer( "Error - Unknown IP.", player);
else MessagePlayer( "Subnet(" + text + ")'s aliases: " + GetAlias( text ) + ".", player );
}
}
}