pawn Код:
CMD:kick(playerid, params[])
{
if (P_DATA[ playerid ][ P_Level ] < 4)return SendError( playerid, "You are not allowed to use this command"),SendClientMessage(playerid, COLOR_WHITE, "REASON: Low level!");
if (P_DATA[ playerid ][ P_LoggedIN ] == 0)return SendError( playerid, "Please login to use this command!");
if ( sscanf( params, "us", params[ 0 ] ,params[ 1 ]) )return SendUsage( playerid, "/kick <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( params[ 0 ] == playerid )return SendError( playerid, "You can't kick yourself!");
FormMessageForAllEx(playerid,COLOR_GREEN, "Administrator %s kicked %s from the server! [Reason: %s]",PlayerName2( playerid ), PlayerName2( params[ 0 ] ), params[ 1 ]);
FormMessage( params[ 0 ], COLOR_GREEN, "4 %s kicked you! [Reason: %s ]",PlayerName2( playerid ), params[ 1 ]);
FormMessage( playerid, COLOR_GREEN, "You have kicked %s [Reason: %s]",PlayerName2( params[ 0 ] ), params[ 1 ]);
Kick( params[ 0 ] );
return 1;
}
CMD:ban(playerid, params[])
{
if (P_DATA[ playerid ][ P_Level ] < 4)return SendError( playerid, "You are not allowed to use this command"),SendClientMessage(playerid, COLOR_WHITE, "REASON: Low level!");
if (P_DATA[ playerid ][ P_LoggedIN ] == 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!");
/*if( params[ 0 ] == playerid )
return SendError( playerid, "You can't ban yourself!");*/
FormMessageForAllEx(playerid,COLOR_GREEN, "Administrator %s banned %s from the server! [Reason: %s]",PlayerName2( playerid ), PlayerName2( params[ 0 ] ), params[ 1 ]);
FormMessage( params[ 0 ], COLOR_GREEN, "Administrator %s banned you! [Reason: %s ]",PlayerName2( playerid ), params[ 1 ]);
FormMessage( playerid, COLOR_GREEN, "You have banned %s [Reason: %s]",PlayerName2( params[ 0 ] ), params[ 1 ]);
new gP_FILE[ 256 ];
format( gP_FILE, 256, "Administration/Users/%s.ini", PlayerName2( params[ 0 ] ));
new
INI:pACC = INI_Open( gP_FILE );
INI_WriteInt(pACC, "BANNED", 1 );
INI_Close( pACC );
Ban( params[ 0 ] );
return 1;
}
Some of the few. I guess you know how FormMessage is. It's the define ****** made.
I only use OnPlayerCommandText with CallRemoteFunction. But the commands that use the CallRemoteFunction, weren't even touched!