Menu

Show posts

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 Menu

Messages - Broly

#1
Maybe its a best thread since nobody's gives shit on our post. we have to pay them for replies lmao
#2
Quote from: Saiyan Attack on Dec 09, 2017, 05:57 PM
Quote from: Broly on Dec 09, 2017, 04:30 AM
Quote from: Saiyan Attack on Dec 08, 2017, 07:50 PMHere you Go :-
else if ( cmd == "!ogetip" )
{
if ( !text ) StaffMessage(  ICOL_RED + "Syntax, " + cmd + " <full nickname>" );
else {
local q = QuerySQL(db, "SELECT Nicks, UID FROM Alias WHERE Nicks='"+escapeSQLString(text)+"'");
if (!GetSQLColumnData(q,0)) StaffMessage( ICOL_RED + "Error: This nickname is not registered." );
else {
local b, a=0, q2 = QuerySQL(db,"SELECT Nicks FROM Alias WHERE UID='"+escapeSQLString(GetSQLColumnData(q,1))+"'");
while(GetSQLColumnData(q2,0) != null) {
if ( b ) b = b+", "+GetSQLColumnData(q2,0);
else b = GetSQLColumnData(q2,0);
GetSQLNextRow(q2);
a++;
}
if(a==1) StaffMessage( "[IP-ALIAS] "+ text + "'s IP alias: " + b + "." );
else if(a>=2) StaffMessage( "[IP-ALIAS] "+ text + "'s IP alias: " + b + "." );
else StaffMessage( " "+ text + " has no IP alias." );
FreeSQLQuery(q2);
}
}
}
Thank you Attack its work perfectly i will you give credits :)
and what about
SUBNET IP and UID ?
this command get players name by Detecting their UID if one or more players have same UID Then This will display players name who have same UID and about subnet IP i leave the rest to you ...
I understand Thanks for you support :)
#3
General Discussion / Re: Help Plese
Dec 09, 2017, 02:17 PM
did you replace it ?

#5
Well i give proper command but the function said  "Wrong format, day:hour:min (Numeric)"
What's wrong ?



function IRCAddBan( nick, player, expire, reason = "No Reason" )

{

try{

     //Equation = (DAYS*24*60*60) + (HOUR*60*60) + (MIN*60)

     local ban_Expire = split( expire, ":" ); //days:hours:minutes

if( NumTok( expire, ":" ) == 3 )

{

if( IsNum( ban_Expire[ 0 ] ) &&  IsNum( ban_Expire[ 1 ] ) && IsNum( ban_Expire[ 2 ] ) )

{

         if( ban_Expire[ 0 ].tointeger() <= 31 && ban_Expire[ 1 ].tointeger() <= 24 && ban_Expire[ 2 ].tointeger() <= 60 )

{

        local ban_Expires = ( (ban_Expire[ 0 ].tointeger()*24*60*60) + (ban_Expire[ 1 ].tointeger()*60*60) + (ban_Expire[ 2 ].tointeger()*60) ), 

                    Calc = ban_Expire[ 0 ] + " days " + ban_Expire[ 1 ] + " hours " + ban_Expire[ 2 ] + " minutes.",

                    query = QuerySQL( db, "INSERT INTO Tempban( ban_nick, ban_ip, ban_time, ban_expire, ban_expireratio, ban_admin, ban_reason ) VALUES ( '"+ player.Name.tostring() +"','"+ player.IP.tostring() +"','"+ time().tostring() +"', '"+ ban_Expires.tostring() +"', '" + expire.tostring() + "', '"+ nick.tostring() +"', '"+ reason.tostring() +"')");

Message( "Admin " + nick + " has tempbanned " + player.Name + " Reason: " + reason + " for " + Calc + "" );

StaffMessage( user, ICOL_RED + "You have tempbanned " + player.Name + " successfully!" );

StaffMessage( ICOL_RED + "[" + player.ID + "] " + player.Name + " left the Server. (Kicked)." );

KickPlayer( player );

}

}

else StaffMessage( ICOL_RED + "Time should be numeric (day:hour:min)" );

}

else StaffMessage( ICOL_RED + "Wrong format, day:hour:min (Numeric)" );

}

catch(e) print( "Tempban function Error: " + e );

}

 
and command

else if ( cmd == "tempban" )
     {
      try{
   local txt_Split;
          if ( FindLevel( nick, false )== "User" ) StaffMessage(  ICOL_RED + "You have to be admin to use this command." );
else if( text == "" ) {
StaffMessage(   ICOL_RED + "Syntax, !tempban <player/ID> <day:hour:min> <reason>");
return;
}else
                {
                if( NumTok( text, " " ) == 2 )
{
     txt_Split = split( text, " " );
local plr = GetPlayer( txt_Split[ 0 ] ), expire = txt_Split[ 1 ];
if( plr ) IRCAddBan( nick, plr, expire );
else StaffMessage(   ICOL_RED + "Error: Invalid player." );
}
else if( NumTok( text, " " ) >= 3 )
{
     txt_Split = split( text, " " );
                     local plr = GetPlayer( txt_Split[ 0 ] ), expire = txt_Split[ 1 ], reason = txt_Split[ 2 ];
if( plr ) IRCAddBan( nick, plr, expire, reason );
else StaffMessage( ICOL_RED + "Error: Invalid player." );
}
else StaffMessage(  ICOL_RED + "Syntax, !tempban <player/ID> <day:hour:min> <reason>");
  }
  }
   catch(e) print( "Tempban error: " + e );
     }
P.S
i use
else if( text == "" ) 
instead of
[code]if( !text )
#6
Quote from: Saiyan Attack on Dec 08, 2017, 07:50 PMHere you Go :-
else if ( cmd == "!ogetip" )
{
if ( !text ) StaffMessage(  ICOL_RED + "Syntax, " + cmd + " <full nickname>" );
else {
local q = QuerySQL(db, "SELECT Nicks, UID FROM Alias WHERE Nicks='"+escapeSQLString(text)+"'");
if (!GetSQLColumnData(q,0)) StaffMessage( ICOL_RED + "Error: This nickname is not registered." );
else {
local b, a=0, q2 = QuerySQL(db,"SELECT Nicks FROM Alias WHERE UID='"+escapeSQLString(GetSQLColumnData(q,1))+"'");
while(GetSQLColumnData(q2,0) != null) {
if ( b ) b = b+", "+GetSQLColumnData(q2,0);
else b = GetSQLColumnData(q2,0);
GetSQLNextRow(q2);
a++;
}
if(a==1) StaffMessage( "[IP-ALIAS] "+ text + "'s IP alias: " + b + "." );
else if(a>=2) StaffMessage( "[IP-ALIAS] "+ text + "'s IP alias: " + b + "." );
else StaffMessage( " "+ text + " has no IP alias." );
FreeSQLQuery(q2);
}
}
}
Thank you Attack its work perfectly i will you give credits :)
and what about
SUBNET IP and UID ?
#7
Hi thanks for reply but sorry its not work it gives error at linke no 924 check the pic btw here's the real code of ShowAlias
function ShowAlias( player, plr, option )
#8
Well no there was no error
#10
Hi friends
well first please don't laugh i am just a noob scripter ( beginner ) i am using this  Diego^ Alias System - IP/SUBNET/UID and trying to make Offline alias for irc  but its not work

else if ( cmd == "!ogetip" )
{

local q = QuerySQL(db, "SELECT * FROM Alias WHERE Name='" + text + "'");
  if ( !text ) StaffMessage(  ICOL_RED + "Syntax, " + cmd + " <full nickname>" );
else if ( GetSQLColumnData( q, 0 ) != text ) EchoMessage( ICOL_RED + "Error: This nickname is not registered." );
else if( (GetSQLColumnData( q, 0 ) == text ) || (GetSQLColumnData( q1, 0 ) == text ) )
{
 ShowAlias( text, plr, "ip" );
}

FreeSQLQuery( q );
}
}
and function
function ShowAlias( player, plr, option )
{
if ( option == "ip" )
{
local i = 0, a = Alias.len(), b;
while( i < a )
{
if ( plr.IP == Alias[i].IP && plr.Name != Alias[i].Nick )
{
if ( b ) b = b + ", " + Alias[i].Nick;
else b = Alias[i].Nick;
}
i ++;
}
if ( !b ) StaffMessage( " "+ plr.Name + " has no IP alias." );
else StaffMessage( "[IP-ALIAS] "+ plr.Name + "'s IP alias: " + b + "." );
}
else if ( option == "subnet" )
{
local i = 0, a = Alias.len(), b;
local getsub_1 = split( player.IP, "." ),
sub_1 = getsub_1[0] + getsub_1[1];
while( i < a )
{
local getsub_2 = split( Alias[i].IP, "." ),
sub_2 = getsub_2[0] + getsub_2[1];
if ( sub_1 == sub_2 && plr.Name != Alias[i].Nick )
{
if ( b ) b = b + ", " + Alias[i].Nick;
else b = Alias[i].Nick;
}
i ++;
}
if ( !b ) StaffMessage( "[Server] "+ plr.Name + " has no subnet alias." );
else StaffMessage( "[IP-ALIAS] "+ plr.Name + "'s IP alias: " + b + "." );
}
else if ( option == "uid" )
{
local i = 0, a = Alias.len(), b;
while( i < a )
{
if ( plr.UniqueID == Alias[i].UID && plr.Name != Alias[i].Nick )
{
if ( b ) b = b + ", " + Alias[i].Nick;
else b = Alias[i].Nick;
}
i ++;
}
if ( !b ) StaffMessage( "[Server]"+ plr.Name + " has no uid alias." );
else StaffMessage( "[IP-ALIAS] "+ plr.Name + "'s IP alias: " + b + "." );
}
}
Any help would appreciate
#11
Solved 
#12
Hello any one ?
#13
Check the function please, is there any problem with it ? actually its showing wrong level on IRC i use  print( FindLevel(user, false) ) to find my real level in consel and it shows you're USER but i have ( ~ ) sign on IRC here's the code

else if ( EventID == "366" )
{
// A dynamic array to store each user's class instance in.
NickList <- [];

// Now, Lets parse the names query.
local
FindUsers = split( raw[ 0 ], ":" ),
users = split( FindUsers[ 1 ], " " );

// Iterate our parsed list of users.
for ( local i = 0; i < users.len(); i++ )
{
// Establish the level symbol.
local
Level = users[ i ].slice( 0, 1 );

if ( Level == "~" ) NickList.push( UserLevels( users[ i ].slice( 1, users[ i ].len() ), "Owner", 5 ) );
else if ( Level == "&" ) NickList.push( UserLevels( users[ i ].slice( 1, users[ i ].len() ), "SOP", 4 ) );
else if ( Level == "@" ) NickList.push( UserLevels( users[ i ].slice( 1, users[ i ].len() ), "AOP", 3 ) );
else if ( Level == "%" ) NickList.push( UserLevels( users[ i ].slice( 1, users[ i ].len() ), "HOP", 2 ) );
else if ( Level == "+" ) NickList.push( UserLevels( users[ i ].slice( 1, users[ i ].len() ), "VOP", 1 ) );
else NickList.push( UserLevels( users[ i ], "User", 0 ) );
}
}

picture