18.02.2012, 15:54
Admin command:
pawn Код:
CMD:admins(playerid, params[]) //credits to lamarr
{
new string[ 900 ];
new fstring[ 900 ];
new adutyrank[ 50 ];
for( new slots = GetMaxPlayers( ), i; i < slots; i++ )
{
if ( !IsPlayerConnected( i ) ) continue;
switch( PlayerInfo[ i ][ Admin ] )
{
case 1: AdminRank = "Moderator";
case 2: AdminRank = "Global Moderator";
case 3: AdminRank = "Administrator";
case 4: AdminRank = "Operator";
case 5: AdminRank = "Head Administrator";
case 6: AdminRank = "Mapper";
case 7: AdminRank = "Scripter";
case 8: AdminRank = "Head Scripter";
case 9: AdminRank = "Co-Owner";
case 10: AdminRank = "Server-Owner";
}
switch( IsAdminInDuty[ i ] )
{
case 0: adutyrank = ""red"Playing!";
case 1: adutyrank = ""green"On Duty!";
}
if( PlayerInfo[ i ][ Admin ] > 0 )
{
new pname[ MAX_PLAYER_NAME ];
GetPlayerName( i, pname, MAX_PLAYER_NAME );
format( fstring, 900,""white"%s (ID:%i) - "red"Level: "white"%i | %s | %s"white"\n", pname, i, PlayerInfo[ i ][ Admin ], AdminRank, adutyrank );
strcat( string, fstring, 900 );
}
}
ShowPlayerDialog( playerid, 2563, DIALOG_STYLE_MSGBOX, "Administrator Online", string, "OK", "" );
return 1;
}