pawn Код:
stock KickPlayer( playerid, Reason[], Reason2[], playerwhokicked )
{
if( IsPlayerConnected( playerid ) )
{
new string[ 128 ], Name[ MAX_PLAYER_NAME ];
GetPlayerName( playerid, Name, sizeof( Name ) );
if( playerwhokicked == -255 )
{
format( string, sizeof( string ), "AdmCmd: %s has been kicked, reason: %s", Name, Reason );
SendClientMessageToAll( COLOR_RED, string );
format( string, sizeof( string ), "You have been kicked for %s.", Reason2 );
Kick( playerid );
print( string );
}
else
{
new KickerName[ MAX_PLAYER_NAME ];
GetPlayerName( playerwhokicked, KickerName, sizeof( KickerName ) );
format( string, sizeof( string ), "AdmCmd: %s has been kicked by %s, reason: %s", Name, KickerName, Reason );
SendClientMessageToAll( COLOR_RED, string );
format( string, sizeof( string ), "You have been kicked for %s.", Reason2 );
Kick( playerid );
print( string );
}
}
else
{
printf( "KickPlayer() was called, but the playerid (%d) inserted into the function wasn't a valid ID.", playerid ) );
}
}
//KickPlayer( playerid, "DMing", "Deathmatching", -255 );