pai sa-ti dau un exemplu de comanda de admin din GM-ul meu
CMD:kick( playerid, params[ ] )
{
new
m_gString [ 256 ],
g_aString [ 256 ],
pName [ 24 ],
oName [ 24 ],
pIP [ 50 ],
Reason [ 256 ],
P_ID
;
new year, month, date; getdate(year, month, date);
new hour, minute, second; gettime(hour, minute, second);
if( pData [ playerid ] [ pAdmin ] < 1 )
return SendError( playerid, "You are not authorized to use this command! ");
if( sscanf ( params, "is[256]", P_ID, Reason ) )
return SendUsage( playerid, "/kick [id] [reason] ");
if( P_ID == playerid )
return SendError( playerid, "You cannot kick yourself! ");
GetPlayerName( playerid, pName, sizeof ( pName ) );
GetPlayerName( P_ID, oName, sizeof ( oName ) );
GetPlayerIp( P_ID, pIP, sizeof ( pIP ) );
format( m_gString, sizeof ( m_gString ), ">> %s (ID: %d) has kicked %s (ID: %d) for: %s ", pName, playerid, oName, P_ID, Reason );
SendClientMessageToAll( COLOR_ORANGE, m_gString );
format( m_gString, sizeof ( m_gString ), "(ModMsg) %s (ID: %d) has kicked %s (ID: %d) for: %s (IP: %s) ", pName, playerid, oName, P_ID, Reason, pIP );
SendModMsg( COLOR_YELLOW, m_gString );
SendClientMessage( playerid, -1, "");
format( g_aString, sizeof ( g_aString ), ">> You have been kicked, write down this informations: ");
SendClientMessage( playerid, COLOR_ORANGE, g_aString );
format( g_aString, sizeof ( g_aString ), ">> Admin: %s (ID: %d) ", pName, playerid );
SendClientMessage( playerid, COLOR_YELLOW, g_aString );
format( g_aString, sizeof ( g_aString ), ">> Reason: %s", Reason );
SendClientMessage( playerid, COLOR_YELLOW, g_aString );
format( g_aString, sizeof ( g_aString ), ">> Date: %d/%d/%d ", year, month, date );
SendClientMessage( playerid, COLOR_YELLOW, g_aString );
format( g_aString, sizeof ( g_aString ), ">> Time: %d/%d/%d ", hour, minute, second );
SendClientMessage( playerid, COLOR_YELLOW, g_aString );
format( g_aString, sizeof ( g_aString ), ">> IP: %s", pIP );
SendClientMessage( playerid, COLOR_YELLOW, g_aString );
format( g_aString, sizeof ( g_aString ), "If you think it was wrongfully, take a screenshot and complain at our forum. ");
SendClientMessage( playerid, COLOR_ORANGE, g_aString );
SendClientMessage( playerid, COLOR_ORANGE, "Our forum can be found at: ......");
Kick ( P_ID );
return 1;
}