[Tutorial] RE:- M.U.G-BAN : (ADVANCED BANNING SYSTEM) USING <ZCMD> : HACKER WONT BE BACK !!!!!
#1

Код:
I knew alot of poeple will commnads "not detailed" that's why i have written all things with fully detailed and have maked it clear And please dont give your worst and bad commands if you dont like it .
Hello user's wassup ? i saw alot of poeple like they are getting server attack by hackers and other thing even they try to ban but again they can join my ip changing so we are going to create an hard ban system !!!!

Equations :
  • Advanced ban command made
  • Using zcmd
  • Hacker's wont be back
1 ):-Starting...

ZCMD is one of fast command maker and you can download this include from "".We will use zcmd for making the commands so add this at the top of your script of filterscript and make sure that you can < zcmd.inc > at your server pawn/Include folder.
pawn Код:
#include <zcmd>
  • then we will start up with making the commands of /BAN
pawn Код:
CMD:ban(playerid, params[]) //>>:- instante of CMD you also can use COMMAND:
{
  • Then we will see if the player is admin ? or either is he high enough lvl to use this commands so we will put secure :
pawn Код:
if (P_DATA[ playerid ][ P_Level ] < 3)return SendError( playerid, "You are not allowed to use this command"),SendReason( playerid, " not authorised!");
this wont allow the member of an server to use this commands becouse he'll need to be admin lvl 3 or you can edit it .
pawn Код:
if (P_DATA[ playerid ][ P_Level ] <3) //---> this will get the player information you can change the 3 to any admin lvl with will be asked to have :D
2 ):-2nd
  • now we will define that the player's who are not login also can use it they'll need to be logged in
pawn Код:
if (P_DATA[ playerid ][ P_Logged ] == 0)return SendError( playerid, "Please login to use this command!");
here the
pawn Код:
if (P_DATA[ playerid ][ P_Logged ] == 0)
this will get the un-logged player information and wont allowed then to use becosue of 0 mean not :

3 ):-3rd
now if the %s player are logged in and he is admin so the system will send him the useage on how to use it : as

pawn Код:
if ( sscanf( params, "us", params[ 0 ] ,params[ 1 ]) )return SendUsage( playerid, "/ban <id> [reason]" );

if (P_DATA[ params[ 0 ] ][ P_Level ] > P_DATA[ playerid ][ P_Level ])return SendError( playerid, "You have no rights to use admin commands on higher admins!");
In other case we can make it like you cant ban your self so that we will use
pawn Код:
if( params[ 0 ] == playerid )return SendError( playerid, "You can't ban yourself!");
NOw we will make a client random message to send to all player like
pawn Код:
FormMessageForAllEx(playerid,COLOR_RED, "Administrator %s has Perminatly banned %s from the server ! [Reason: %s]",PlayerName2( playerid ), PlayerName2( params[ 0 ] ), params[ 1 ]);
and then for the person who is banned :
pawn Код:
FormMessage( params[ 0 ], COLOR_RED, "Administrator %s has perminatly banned you! [Reason: %s ]",PlayerName2( playerid ), params[ 1 ]);
4 ):-4th
  • Now we will create the file storage mean we can also make it to ban or un-ban from the file !!!!!
now to create it first we will use
pawn Код:
new gP_FILE[ 256 ];
and we will create the /admin/users/%s.ini
pawn Код:
format( gP_FILE, 256, "Administration/Users/%s.ini", PlayerName2( params[ 0 ] ));
the place where to place it mean
pawn Код:
format( gP_FILE, 256, "Administration/Users/%s.ini",// ---->> the place it should be :
  • Now for making the nameed to be black listed
pawn Код:
new
        iUID = BUD::GetNameUID( PlayerName2( params[ 0 ] ) )
    ;
    BUD::SetIntEntry( iUID, "Banned", 1 ); ---> dont allowed if banned :
now we will create some style i mean the time the date and the reason with the admin name who has banned and who were banned :
pawn Код:
new iString[ 256 ],Y,M,D,H,Mi,File:FILE;
    getdate( Y, M, D );
    gettime( H, Mi );
    format( iString,    258, "===============================================\r\n\
                              Admin: %s\r\n\
                              Level: %d\r\n\
                              Player: %s\r\n\
                              Date: %d/%d/%d at %d:%d\r\n\
                              Reason: %s\r\n\
                              ===============================================\r\n\r\n\r\n"
,
                              PlayerName2( playerid ),
                              P_DATA[ playerid ][ P_Level ],
                              PlayerName2( params[ 0 ] ),
                              D,
                              M,
                              Y,
                              H,
                              Mi,
                              params[ 1 ] );


    FILE = fopen(SlogBan, io_append);
    if (FILE)
    {
        fwrite(FILE, iString);
        fclose(FILE);
    }
    Ban(params[0]);
    return 1;
}
pawn Код:
format( gP_FILE, 256, "Administration/Users/%s.ini",// ---->> the place it should be :
So we will use this under
pawn Код:
public OnPlayerConnect( playerid )
{
now when the %s player (banned) will connect this function might take his/her name from file so that
pawn Код:
new UID = BUD::GetNameUID( PlayerName2( playerid ) );

    if ( UID != BUD::INVALID_UID )
    {
        SetPVarInt( playerid, "BANNED", BUD::GetIntEntry( UID, "Banned" ) );
        if ( GetPVarInt( playerid, "BANNED" ) == 1 )
        {
            FormMessage( playerid, COLOR_RED, "You are Perminattly Banned From This Server.Go away !!!!",0 );
            FormMessageForAll( COLOR_WHITE, "[ \"%s\"] with ID [ \"%i\" ] has been kicked from the server! [Reason: Banned Account]",PlayerName2( playerid ), playerid );
            SetTimerEx( "KickPlayer", 500, false, "i", playerid ); //-->> no need to tell about this . it's too easy
        }
    }
  • Now here this funtion
pawn Код:
SetPVarInt( playerid, "BANNED", BUD::GetIntEntry( UID, "Banned" ) );
        if ( GetPVarInt( playerid, "BANNED" ) == 1 )
this "BANNED" ) == 1 ) this "1" means that the player is banned .If you want to ban a player from file turn the 0 to 1 or 1 to 0 for unban !!!!
pawn Код:
CMD:ban(playerid, params[])
{
    if (P_DATA[ playerid ][ P_Level ] < 3)return SendError( playerid, "You are not allowed to use this command"),SendReason( playerid, " Low level!");
    if (P_DATA[ playerid ][ P_Logged ] == 0)return SendError( playerid, "Please login to use this command!");
    if ( sscanf( params, "us", params[ 0 ] ,params[ 1 ]) )return SendUsage( playerid, "/ban <id> [reason]" );
    if ( !IsPlayerConnected( params[ 0 ] ) )return SendError( playerid, "Player is not connected!");
    if (P_DATA[ params[ 0 ] ][ P_Level ] > P_DATA[ playerid ][ P_Level ])return SendError( playerid, "You have no rights to use admin commands on higher admins!");
    if (P_DATA[ params[ 0 ] ][ P_Level ] > P_DATA[ playerid ][ P_Level ])return SendError( playerid, "You have no rights to use admin commands on higher admins!"); //---- this will get the %s player account information and if he is amdin so the system will let him to use if not then cant use :
    if( params[ 0 ] == playerid )return SendError( playerid, "You can't ban yourself!");

    FormMessageForAllEx(playerid,COLOR_RED, "Administrator %s has Perminatly banned %s from the server ! [Reason: %s]",PlayerName2( playerid ), PlayerName2( params[ 0 ] ), params[ 1 ]);
    FormMessage( params[ 0 ], COLOR_RED, "Administrator %s banned you! [Reason: %s ]",PlayerName2( playerid ), params[ 1 ]);
    FormMessage( playerid, COLOR_YELLOW, "You have banned %s from server [Reason: %s]",PlayerName2( params[ 0 ] ), params[ 1 ]);
    new gP_FILE[ 256 ];
    format( gP_FILE, 256, "Administration/Users/%s.ini", PlayerName2( params[ 0 ] ));
    new
        iUID = BUD::GetNameUID( PlayerName2( params[ 0 ] ) )
    ;
    BUD::SetIntEntry( iUID, "Banned", 1 );


    new iString[ 256 ],Y,M,D,H,Mi,File:FILE; //--- this wll save the player time/second/date/year also
    getdate( Y, M, D );
    gettime( H, Mi );
    format( iString,    258, "===============================================\r\n\
                              Admin: %s\r\n\
                              Level: %d\r\n\
                              Player: %s\r\n\
                              Date: %d/%d/%d at %d:%d\r\n\
                              Reason: %s\r\n\
                              ===============================================\r\n\r\n\r\n"
,
                              PlayerName2( playerid ),
                              P_DATA[ playerid ][ P_Level ],
                              PlayerName2( params[ 0 ] ),
                              D,
                              M,
                              Y,
                              H,
                              Mi,
                              params[ 1 ] );


    FILE = fopen(SlogBan, io_append);
    if (FILE)
    {
        fwrite(FILE, iString);
        fclose(FILE);
    }
    Ban(params[0]);
    return 1;
}
public OnPlayerConnect ( playerid )
{
new UID = BUD::GetNameUID( PlayerName2( playerid ) );

    if ( UID != BUD::INVALID_UID )
    {
        SetPVarInt( playerid, "BANNED", BUD::GetIntEntry( UID, "Banned" ) );
        if ( GetPVarInt( playerid, "BANNED" ) == 1 )
        {
            FormMessage( playerid, COLOR_RED, "You are Perminatly Banned From This Server.Go away !!!!",0 );
            FormMessageForAll( COLOR_WHITE, "[ \"%s\"] with ID [ \"%i\" ] has been kicked from the server! [Reason: Banned Account]",PlayerName2( playerid ), playerid );
            SetTimerEx( "KickPlayer", 500, false, "i", playerid );
        }
    }
Код:
soory i have some other importante work please accept this codes and bye .
Reply
#2

For god sake where is the gpci function? and what's the point to get something that is not yours and post here? without even creating enum's variables and such.



Horrible tutorial.
Reply
#3

Quote:
Originally Posted by leonardo1434
Посмотреть сообщение
For god sake where is the gpci function? and what's the point to get something that is not yours and post here? without even creating enum's variables and such.



Horrible tutorial.
I guess you don't know what gpci does.
Reply
#4

Quote:
Originally Posted by Kiets
Посмотреть сообщение
I guess you don't know what gpci does.
0f course he does'nt xD
Reply
#5

gcpi = players serial, at his tutorial doesn't have that, as it said.
Reply
#6

Quote:
Originally Posted by leonardo1434
Посмотреть сообщение
gcpi = players serial, at his tutorial doesn't have that, as it said.
If you have a server, test it, you will see it isn't.
Reply
#7



What it will stop me if i change my ip and come back hmm ? nothing i dont see "HACKERS WONT BACK" how it will work ? if they can change they ip and come back ? and you call this advanced shame you
Reply
#8

First improve your english pal : then we are using data base version and the player stats and all think with ip and other thing save to there so that it will stop the %S player from entering to server.Dont make BLIND commands before testing it !!!!!
Reply
#9

You've some spelling errors.

Permanently Banned.
Reply
#10

Quote:
Originally Posted by Akira297
Посмотреть сообщение
You've some spelling errors.

Permanently Banned.
thanks and fixed :
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)