[FilterScript] oADMIN - organe Admin system v1.0
#1

Hey, I created first filter script. This is " oAdmin " - organe. Admin system v1.0.

Admin commands:
Quote:

/ban /kick /warning /say

FilterScript use zcmd commands and sscanf. Must have zcmd and sscanf includes, but I upload include's for you.

Код:
FUTURE UPDATES:
* Create levels system " 1 - VIP, 2 - ADMIN, 3 - OWNER
* Create for levels commands
* Add commands for admins
SCRIPT:
pawn Код:
// ========================================================================== //
/*

                    oAdmin - organe. Admin system
                              v1.0

                     Administrator commands:
                       
                - /ban - ban selected player.
                - /kick - kick selected player.
                - /warning - give warning for player.
                - /say - Say text for all players.

                  This is not last system version

*/

// ========================================================================== //

#include < a_samp >
#include < zcmd >
#include < sscanf >

new Admin[ MAX_PLAYERS ];
new Warning[ MAX_PLAYERS ];

public OnPlayerSpawn( playerid )
{
    if( Admin[ playerid ] == 1 )
    {
        new string[ 100 ];
        format( string, 100, "{FF0000}Administrator %s spawned", pName( playerid ) );
        SendClientMessageToAll( -1, string );
    }
    return 1;
}

/* Administrator commands */
COMMAND:ban( playerid, params[ ] )
{
    new ID;
    if( Admin[ playerid ] == 1 ) return 0;
    if( sscanf( params, "us", ID, params ) ) return SendClientMessage( playerid, -1, "{FFFF00}Use example: /ban [ NAME or ID ] [ REASON ].");
    if( !IsPlayerConnected( ID ) ) return SendClientMessage( playerid, -1, "{FFFF00}Selected playerid not connected.");
    else
    {
        new string[ 100 ];
        format( string, 100, "[ BAN ]: Admin [ %s ] banned [ %s ].", pName( playerid ), pName( ID ) );
        SendClientMessageToAll( -1, string );
        format( string, 100, "{FF0000}[] %s ", params );
        SendClientMessageToAll( -1, string );
        Ban( ID );
    }
    return 1;
}
COMMAND:kick( playerid, params[ ] )
{
    new ID;
    if( Admin[ playerid ] == 1 ) return 0;
    if( sscanf( params, "us", ID, params ) ) return SendClientMessage( playerid, -1, "{FFFF00}Use example: /kick [ NAME or ID ] [ REASON ].");
    if( !IsPlayerConnected( ID ) ) return SendClientMessage( playerid, -1, "{FFFF00}Selected playerid not connected.");
    else
    {
        new string[ 100 ];
        format( string, 100, "[ KICK ]: Admin [ %s ] kicked [ %s ].", pName( playerid ), pName( ID ) );
        SendClientMessageToAll( -1, string );
        format( string, 100, "{FF0000}[] %s ", params );
        SendClientMessageToAll( -1, string );
        Kick( ID );
    }
    return 1;
}
COMMAND:say( playerid, params[ ] )
{
    if( Admin[ playerid ] == 1 ) return 0;
    if( sscanf( params, "s", params ) ) return SendClientMessage( playerid, -1, "{FFFF00)Use example: /say [ TEXT ].");
    else
    {
        new string[ 100 ];
        format( string, 100, "Admin [ %s ]: %s", pName( playerid ), params );
        SendClientMessageToAll( -1, string );
    }
    return 1;
}
COMMAND:warning( playerid, params[ ] )
{
    new ID;
    if( Admin[ playerid ] == 1 ) return 0;
    if( sscanf( params, "us", ID, params ) ) return SendClientMessage( playerid, -1, "{FFFF00}Use example: /warning [ NAME or ID ] [ REASON ].");
    if( !IsPlayerConnected( ID ) ) return SendClientMessage( playerid, -1, "{FFFF00}Selected player not connected.");
    else
    {
        new string[ 100 ];
        format( string, 100, "Admin [ %s ] give warning for [ %s ].", pName( playerid ), pName( ID ) );
        SendClientMessageToAll( -1, string );
        format( string, 100, "{FF0000}[] %s", params );
        SendClientMessageToAll( -1, string );
    }
   
    if( Warning[ playerid ] > 5 )
    {
        SendClientMessage( playerid, -1, "Sorry, but you banned for 5 warnings.");
        SendClientMessage( playerid, -1, "For unban please wisit: ");
        Ban( playerid );
    }
    return 1;
}

stock pName(playerid)
{
    new playerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playerName,sizeof(playerName));
    return playerName;
}
INCLUDES:
http://www.failai.lt/qchglb6eox7h/includes.rar.htm - zcmd & sscanf

Comment & rate, this is my first realased filterscript and sorry for my bad english.
Reply
#2

hmmm nice xD but this could not be compared to admin scripts that has been released (luxadmin , 0admin .ladmin...)

please try to do something unique xD


anw good job xD
Reply
#3

okay, the next update of sincere and something new
Reply
#4

Hehehe Nice But nothing special..
Reply
#5

thanks, try create something unique
Reply
#6

From this!
Код:
COMMAND:kick(playerid, params[ ] )
{
    new ID;
    if( Admin[ playerid ] == 1 ) return 0;
    if( sscanf( params, "us", ID, params ) ) return SendClientMessage( playerid, -1, "{FFFF00}Use example: /kick [ NAME or ID ] [ REASON ].");
    if( !IsPlayerConnected( ID ) ) return SendClientMessage( playerid, -1, "{FFFF00}Selected playerid not connected.");
    else
    {
        new string[ 100 ];
        format( string, 100, "[ KICK ]: Admin [ %s ] kicked [ %s ].", pName( playerid ), pName( ID ) );
        SendClientMessageToAll( -1, string );
        format( string, 100, "{FF0000}[] %s ", params );
        SendClientMessageToAll( -1, string );
        Kick( ID );
    }
    return 1;
}
To this
Код:
CMD:kick(playerid, params[])
{
    new ID;
    if( Admin[ playerid ] == 1 ) return 0;
    if( sscanf( params, "us", ID, params ) ) return SendClientMessage( playerid, -1, "{FFFF00}Use example: /kick [ NAME or ID ] [ REASON ].");
    if( !IsPlayerConnected( ID ) ) return SendClientMessage( playerid, -1, "{FFFF00}Selected playerid not connected.");
    else
    {
        new string[ 100 ];
        format( string, 100, "[ KICK ]: Admin [ %s ] kicked [ %s ].", pName( playerid ), pName( ID ) );
        SendClientMessageToAll( -1, string );
        format( string, 100, "{FF0000}[] %s ", params );
        SendClientMessageToAll( -1, string );
        Kick( ID );
    }
    return 1;
}
much easyer and faster (my option)
Reply
#7

Nice !
Reply
#8

Quote:
Originally Posted by Deanx
Посмотреть сообщение
Nice !
Very thans
Reply
#9

You should work on your english, and fix that wisit, its visit, not good for anyone besides, keep trying and learning.
Reply
#10

1: No saving for admin..
2: Warn command doesen't have a function that gives "Warning[ playerid ]" +1 with every given warn..
3: And how the f**k i get admin? There is no command like "/makeadmin" or "/setlevel"..

Update your admin script and make more commands, my suggestion..
Reply
#11

Thanks, in next update create.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)