[SNIPPET] BanInfo Command.

Started by Mohamed Boubekri, Nov 19, 2017, 07:11 PM

Previous topic - Next topic

Mohamed Boubekri

Hello The Command Already Posted For Liberty City Forum
But its For VCMP 0.3
I'm Transfered It To 0.4 Only For the Newbie.

Command : ( For The Ban System @Diego^ )

else if ( cmd == "baninfo" )
{
if ( !text ) MessagePlayer( "[#00BBFF][INFO][#ffffff] /baninfo <Full-Nick>", player );
// If Player Not Logged In Message Here
// Level To Acces As That Command
else {
local q = QuerySQL( db,  "SELECT * FROM SubBans WHERE Name='" + text + "'" );
if ( GetSQLColumnData( q, 0 ) != text ) MessagePlayer( "[#ff0000][Error] - " + text + " is not Banned.", player );
else
{
MessagePlayer( "[#00ffff][INFO][#ffffff] Player Name Found!", player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Player : " + text, player );
MessagePlayer( "[#00ffff][INFO][#ffffff] IP : " + GetSQLColumnData( q, 1 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Banned by : " + GetSQLColumnData( q, 2 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Reason : " + GetSQLColumnData( q, 3 ), player );
}
}
}

Command : ( For the Ban System @zeus )

else if ( cmd == "baninfo" )
{
if ( !text ) MessagePlayer( "[#00BBFF][INFO][#ffffff] /baninfo <Full-Nick>", player );
// If Player Not Logged In Message Here
// Level To Acces As That Command
else {
local q = QuerySQL( db, "SELECT * FROM Bans WHERE Name='" + text + "' COLLATE NOCASE" );
if ( GetSQLColumnData( q, 0 ) != text ) MessagePlayer( "[#ff0000][Error] - " + text + " is not Banned.", player );
else
{
MessagePlayer( "[#00ffff][INFO][#ffffff] Player Name Found!", player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Player : " + text, player );
MessagePlayer( "[#00ffff][INFO][#ffffff] IP : " + GetSQLColumnData( q, 1 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Banned by : " + GetSQLColumnData( q, 2 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Reason : " + GetSQLColumnData( q, 3 ), player );
}
}
}

                                                                                Hope Its Help :D




| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].

=RK=MarineForce


=RK=MarineForce

Zeus Give me A Command And Function!

How To Check Player Alias. From IP ???

Example /alias Marine

""""""""""""""" =RK=MarineForce [GGO]MarineForce [VU]SAFAFASF =TRC=AT35235

Mohamed Boubekri

Quote from: Mohamed on Nov 19, 2017, 07:11 PMHello The Command Already Posted For Liberty City Forum
But its For VCMP 0.3
I'm Transfered It To 0.4 Only For the Newbie.

Command : ( For The Ban System @Diego^ )

else if ( cmd == "baninfo" )
{
if ( !text ) MessagePlayer( "[#00BBFF][INFO][#ffffff] /baninfo <Full-Nick>", player );
// If Player Not Logged In Message Here
// Level To Acces As That Command
else {
local q = QuerySQL( db,  "SELECT * FROM SubBans WHERE Name='" + text + "'" );
if ( GetSQLColumnData( q, 0 ) != text ) MessagePlayer( "[#ff0000][Error] - " + text + " is not Banned.", player );
else
{
MessagePlayer( "[#00ffff][INFO][#ffffff] Player Name Found!", player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Player : " + text, player );
MessagePlayer( "[#00ffff][INFO][#ffffff] IP : " + GetSQLColumnData( q, 1 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Banned by : " + GetSQLColumnData( q, 2 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Reason : " + GetSQLColumnData( q, 3 ), player );
}
}
}

Command : ( For the Ban System @zeus )

else if ( cmd == "baninfo" )
{
if ( !text ) MessagePlayer( "[#00BBFF][INFO][#ffffff] /baninfo <Full-Nick>", player );
// If Player Not Logged In Message Here
// Level To Acces As That Command
else {
local q = QuerySQL( db, "SELECT * FROM Bans WHERE Name='" + text + "' COLLATE NOCASE" );
if ( GetSQLColumnData( q, 0 ) != text ) MessagePlayer( "[#ff0000][Error] - " + text + " is not Banned.", player );
else
{
MessagePlayer( "[#00ffff][INFO][#ffffff] Player Name Found!", player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Player : " + text, player );
MessagePlayer( "[#00ffff][INFO][#ffffff] IP : " + GetSQLColumnData( q, 1 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Banned by : " + GetSQLColumnData( q, 2 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Reason : " + GetSQLColumnData( q, 3 ), player );
}
}
}

                                                                                Hope Its Help :D






Thanks Bro @=RK=MarineForce :P

Quote from: =RK=MarineForce on Nov 20, 2017, 02:46 PMZeus Give me A Command And Function!

How To Check Player Alias. From IP ???

Example /alias Marine

""""""""""""""" =RK=MarineForce [GGO]MarineForce [VU]SAFAFASF =TRC=AT35235
Hm @=RK=MarineForce Lets Me Check The alias System.
| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].

Mohamed Boubekri

#4
@MarineForce Try it.

else if ( cmd == "baninfo" )
{
if ( !text ) MessagePlayer( "[#00BBFF][INFO][#ffffff] /baninfo <Full-Nick>", player );
// If Player Not Logged In Message Here
// Level To Acces As That Command
else {
local q = QuerySQL( sqliteDB, "SELECT * FROM Alias" );
if ( GetSQLColumnData( q, 0 ) != text ) MessagePlayer( "[#ff0000][Error] - " + text + " is not Banned.", player );
else
{
MessagePlayer( "[#00ffff][INFO][#ffffff] Player Name Found!", player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Player : " + text, player );
MessagePlayer( "[#00ffff][INFO][#ffffff] IP : " + GetSQLColumnData( q, 1 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Banned by : " + GetSQLColumnData( q, 2 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Reason : " + GetSQLColumnData( q, 3 ), player );
}
}
}
| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].


=RK=MarineForce


Mohamed Boubekri

| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].

=RK=MarineForce

@Mohamed Bro!

Give me This Function And Commands so i want! it pls.

 /ban : NOT IP Ban /unban NOT IP Unban

 /ban <FullNick> <Reason>
/ban =RK=MarineForce Reason HP Hack.

CilentMessageToAll(" Admin =RK=MarineForce Has Banned =RK=MarineForceee Reason HP Hacked .

=RK=MarineForce

This Work For Me

else if ( cmd == "baninfo" )
{
if ( !text ) MessagePlayer( "[#00BBFF][INFO][#ffffff] /baninfo <Full-Nick>", player );
// If Player Not Logged In Message Here
// Level To Acces As That Command
else {
local q = QuerySQL( db, "SELECT * FROM Bans WHERE Name='" + text + "' COLLATE NOCASE" );
if ( GetSQLColumnData( q, 0 ) != text ) MessagePlayer( "[#ff0000][Error] - " + text + " is not Banned.", player );
else
{
MessagePlayer( "[#00ffff][INFO][#ffffff] Player Name Found!", player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Player : " + text, player );
MessagePlayer( "[#00ffff][INFO][#ffffff] IP : " + GetSQLColumnData( q, 1 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Banned by : " + GetSQLColumnData( q, 2 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Reason : " + GetSQLColumnData( q, 3 ), player );
}
}
}

I Don't Know The Problem ! This Don't Work For me
Quote from: Mohamed on Nov 20, 2017, 02:51 PM@MarineForce Try it.

else if ( cmd == "baninfo" )
{
if ( !text ) MessagePlayer( "[#00BBFF][INFO][#ffffff] /baninfo <Full-Nick>", player );
// If Player Not Logged In Message Here
// Level To Acces As That Command
else {
local q = QuerySQL( sqliteDB, "SELECT * FROM Alias" );
if ( GetSQLColumnData( q, 0 ) != text ) MessagePlayer( "[#ff0000][Error] - " + text + " is not Banned.", player );
else
{
MessagePlayer( "[#00ffff][INFO][#ffffff] Player Name Found!", player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Player : " + text, player );
MessagePlayer( "[#00ffff][INFO][#ffffff] IP : " + GetSQLColumnData( q, 1 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Banned by : " + GetSQLColumnData( q, 2 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Reason : " + GetSQLColumnData( q, 3 ), player );
}
}
}

else if ( cmd == "baninfo" )
{
if ( !text ) MessagePlayer( "[#00BBFF][INFO][#ffffff] /baninfo <Full-Nick>", player );
// If Player Not Logged In Message Here
// Level To Acces As That Command
else {
local q = QuerySQL( sqliteDB, "SELECT * FROM Alias" );
if ( GetSQLColumnData( q, 0 ) != text ) MessagePlayer( "[#ff0000][Error] - " + text + " is not Banned.", player );
else
{
MessagePlayer( "[#00ffff][INFO][#ffffff] Player Name Found!", player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Player : " + text, player );
MessagePlayer( "[#00ffff][INFO][#ffffff] IP : " + GetSQLColumnData( q, 1 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Banned by : " + GetSQLColumnData( q, 2 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Reason : " + GetSQLColumnData( q, 3 ), player );
}
}
}

Mohamed Boubekri

@=RK=MarineForce Ok Try it.
else if ( cmd == "baninfo" )
{
if ( !text ) MessagePlayer( "[#00BBFF][INFO][#ffffff] /baninfo <Full-Nick>", player );
// If Player Not Logged In Message Here
// Level To Acces As That Command
else {
local q = QuerySQL( db, "SELECT * FROM Alias WHERE Name='" + text + "' COLLATE NOCASE" );
if ( GetSQLColumnData( q, 0 ) != text ) MessagePlayer( "[#ff0000][Error] - " + text + " is not Banned.", player );
else
{
MessagePlayer( "[#00ffff][INFO][#ffffff] Player Name Found!", player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Player : " + text, player );
MessagePlayer( "[#00ffff][INFO][#ffffff] IP : " + GetSQLColumnData( q, 1 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Banned by : " + GetSQLColumnData( q, 2 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Reason : " + GetSQLColumnData( q, 3 ), player );
}
}
}

or Try it.

else if ( cmd == "baninfo" )
{
if ( !text ) MessagePlayer( "[#00BBFF][INFO][#ffffff] /baninfo <Full-Nick>", player );
// If Player Not Logged In Message Here
// Level To Acces As That Command
else {
local q = QuerySQL( db,  "SELECT * FROM Alias WHERE Name='" + text + "'" );
if ( GetSQLColumnData( q, 0 ) != text ) MessagePlayer( "[#ff0000][Error] - " + text + " is not Banned.", player );
else
{
MessagePlayer( "[#00ffff][INFO][#ffffff] Player Name Found!", player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Player : " + text, player );
MessagePlayer( "[#00ffff][INFO][#ffffff] IP : " + GetSQLColumnData( q, 1 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Banned by : " + GetSQLColumnData( q, 2 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Reason : " + GetSQLColumnData( q, 3 ), player );
}
}
}
| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].

=RK=MarineForce

@Mohamed This is Not Showing OF Player Alias From  Database.

So i want Show Alias From HIM db

Example.

 /alias MYName

Alias OF "+plr.Name+" VOOD GDOOSS AGATA TAT ATAOT3ATA3 5Q35 151R1R1 R1

Mohamed Boubekri

Okay @=RK=MarineForce try it Now That its Command :P

if ( cmd == "ipalias" )
{
if ( !text ) MessagePlayer( "Syntax: /" + cmd + " <Nick/ID>", player );
else
{
local plr = GetPlayer( text );
if ( !plr ) MessagePlayer( "Unknown Player.", player );
else ShowAlias( player, plr, "ip" );
}
}
And Add That For Functions

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 ) MessagePlayer( plr.Name + " has no IP alias.", player );
else MessagePlayer( plr.Name + "'s IP alias: " + b + ".", player );
}
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 ) MessagePlayer( plr.Name + " has no Subnet alias.", player );
else MessagePlayer( plr.Name + "'s Subnet alias: " + b + ".", player );
}
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 ) MessagePlayer( plr.Name + " has no UID alias.", player );
else MessagePlayer( plr.Name + "'s UID alias: " + b + ".", player );
}
}
| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].

=RK=MarineForce

Yeah This is Right Bro

But i am typing /ipalias Marine Not Showing?

!

Quote from: Mohamed on Nov 20, 2017, 03:24 PMfunction 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 ) MessagePlayer( plr.Name + " has no IP alias.", player );
else MessagePlayer( plr.Name + "'s IP alias: " + b + ".", player );
}
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 ) MessagePlayer( plr.Name + " has no Subnet alias.", player );
else MessagePlayer( plr.Name + "'s Subnet alias: " + b + ".", player );
}
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 ) MessagePlayer( plr.Name + " has no UID alias.", player );
else MessagePlayer( plr.Name + "'s UID alias: " + b + ".", player );
}
}
Quote from: =RK=MarineForce on Nov 20, 2017, 06:42 PMYeah This is Right Bro

But i am typing /ipalias Marine Not Showing?

It was never ment to since this index (Alias) is not even specified

Quote from: Mohamed on Nov 20, 2017, 03:24 PMfunction ShowAlias( player, plr, option )
local i = 0, a = Alias.len(), b;

Discord: zeus#5155