29.12.2013, 20:20
(
Последний раз редактировалось ZBits; 16.08.2014 в 20:36.
)
Fixed
COMMAND:admins(playerid)
{
new PlayerName[MAX_PLAYER_NAME],
Admins[4],
AdminsString[4][100]
;
for(new i=0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i) || pInfo[i][pAdmin] < 1) continue;
GetPlayerName(i, PlayerName, MAX_PLAYER_NAME);
switch(pInfo[i][pAdmin])
{
case 1:
{
if(Admins[0] == 0) format(String, sizeof(String), "Present Moderators: %s (%d)", PlayerName, i);
else format(String, sizeof(String), ", %s (%d)", PlayerName, i);
strcat(AdminsString[0], String);
Admins[0] ++;
}
case 2:
{
if(Admins[1] == 0) format(String, sizeof(String), "Present Administrators: %s (%d)", PlayerName, i);
else format(String, sizeof(String), ", %s (%d)", PlayerName, i);
strcat(AdminsString[1], String);
Admins[1] ++;
}
case 3:
{
if(Admins[2] == 0) format(String, sizeof(String), "Present Managers: %s (%d)", PlayerName, i);
else format(String, sizeof(String), ", %s (%d)", PlayerName, i);
strcat(AdminsString[2], String);
Admins[2] ++;
}
case 4:
{
if(Admins[3] == 0) format(String, sizeof(String), "Present Owners: %s (%d)", PlayerName, i);
else format(String, sizeof(String), ", %s (%d)", PlayerName, i);
strcat(AdminsString[3], String);
Admins[3] ++;
}
}
}
if(Admins[0] == 0) format(AdminsString[0], sizeof(AdminsString[0]), "Present Moderators: None");
if(Admins[1] == 0) format(AdminsString[1], sizeof(AdminsString[1]), "Present Administrators: None");
if(Admins[2] == 0) format(AdminsString[2], sizeof(AdminsString[2]), "Present Managers: None");
if(Admins[3] == 0) format(AdminsString[3], sizeof(AdminsString[3]), "Present Owners: None");
SendClientMessage(playerid,0xB0F1F5AA,"Present Staff Members:");
for(new i; i<3; i++) SendClientMessage(playerid, -1, AdminsString[i]);
return 1;
}