29.06.2014, 12:35
PHP код:
CMD:admins(playerid,params[])
{
new Count = 0;
new n[MAX_PLAYER_NAME];
new string[1000];
// SendClientMessage(playerid, 0x00FF00FF, "__________|Admins|__________");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(PlayerInfo[i][Level] < 1) continue;
GetPlayerName(i,n,sizeof(n));
format(string,sizeof(string),"%sLevel %d: %s (ID: %d) - %s\n", string, PlayerInfo[i][Level], n, i, GetRankFromLevel(i));
Count++;
}
if(Count == 0)
{
ShowPlayerDialog(playerid, 2,DIALOG_STYLE_MSGBOX, "Online Admins", "No Admins Online", "OK", "");
return 1;
}
ShowPlayerDialog(playerid, 2,DIALOG_STYLE_MSGBOX, "Online Admins", string, "OK", "");
return 1;
}
stock GetRankFromLevel(playerid)
{
new Rank[40];
switch(PlayerInfo[playerid][Level])
{
case 0:
{
Rank = "Regular Player";
}
case 1:
{
Rank = "Level 1";
}
case 2:
{
Rank = "Level 2";
}
case 3:
{
Rank = "Level 3";
}
case 4:
{
Rank = "Level 4";
}
case 5:
{
Rank = "Level 5";
}
case 6:
{
Rank = "Level 6";
}
}
return Rank;
}