[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


Messages In This Thread
oADMIN - organe Admin system v1.0 - by organe. - 08.04.2012, 18:09
Re: oADMIN - organe Admin system v1.0 - by [XS]Scarface - 08.04.2012, 18:12
Re: oADMIN - organe Admin system v1.0 - by organe. - 08.04.2012, 18:14
Re: oADMIN - organe Admin system v1.0 - by Knight_Rider - 08.04.2012, 18:16
Re: oADMIN - organe Admin system v1.0 - by organe. - 08.04.2012, 18:17
Re: oADMIN - organe Admin system v1.0 - by [EuG]ZeRoGoD - 08.04.2012, 18:22
Re: oADMIN - organe Admin system v1.0 - by Deanx - 08.04.2012, 18:30
Re: oADMIN - organe Admin system v1.0 - by organe. - 08.04.2012, 18:30
Re: oADMIN - organe Admin system v1.0 - by Issam - 08.04.2012, 19:13
Re: oADMIN - organe Admin system v1.0 - by rVar - 08.04.2012, 19:39
Re: oADMIN - organe Admin system v1.0 - by organe. - 08.04.2012, 20:41

Forum Jump:


Users browsing this thread: 1 Guest(s)