03.02.2016, 10:19
PHP Code:
CMD:admins(playerid, params[])
{
new playername[MAX_PLAYER_NAME];
if(GetPlayerScore(playerid) < 50) return SendClientMessage(playerid, COLOR_RED, "You need 50 score to see online administrators");
new count = 0, string[828], AdmRank[128];
new ChangeColor;
SendClientMessage(playerid, COLOR_GREEN, " ");
SendClientMessage(playerid, COLOR_GREEN, "___________ |- Online Admins -| ___________");
SendClientMessage(playerid, COLOR_GREEN, " ");
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i))
{
if (adlvl[i] >= 1)
{
GetPlayerName(i, playername, MAX_PLAYER_NAME);
if(adlvl[i] > 6)
{
AdmRank = "Server Owner/Developer";
ChangeColor = COL_LEVEL4;
}
else
{
switch(adlvl[i])
{
case 1: {
AdmRank = "Moderator";
ChangeColor = COL_LEVEL1;
}
case 2: {
AdmRank = "Senior Moderator";
ChangeColor = COL_LEVEL2;
}
case 3: {
AdmRank = "Administrator";
ChangeColor = COL_LEVEL3;
}
case 4: {
AdmRank = "Lead Administrator";
ChangeColor = COL_LEVEL4;
}
case 5: {
AdmRank = "Lead Administrator";
ChangeColor = COL_LEVEL4;
}
}
}
}
format(string, 128, "%s | %s", playername, AdmRank);
SendClientMessage(playerid, ChangeColor, string);
count ++;
}
}
if(count == 0)
SendClientMessage(playerid, ADMINSONLINE, "There are currently no administrators online.");
return 1;
}
Code:
SendClientMessage(playerid, string, ChangeColor);
PHP Code:
SendClientMessage(playerid, ChangeColor, string);