CMD:lideres(playerid) { SendClientMessage(playerid, 0xBFC0C2FF, "(-------------------({FFD700}Lideres Online{BFC0C2})-------------------)"); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { new str[80]; format(str, sizeof(str), "ORGS/%s.ini", GetOrgName(i)); // pegar nome da org dos players e ver se tem algum online OrgInfo[i][Lider] = DOF2_GetInt(str, "Lider"); new stx[120]; format(stx, sizeof(stx), "Lider: %s, Org: %s", GetNome(i), GetOrgName(i)); SendClientMessage(playerid, -1, stx); } } return 1; }
CMD:lideres(playerid) { SendClientMessage(playerid, 0xBFC0C2FF, "(-------------------({FFD700}Lideres Online{BFC0C2})-------------------)"); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(OrgInfo[i][Cargo] == 6) //Verifica se o player й Lнder e formata/envia uma mensagem diferente/destacada { new str[120]; format(str, sizeof(str), "Lider: %s, Org: %s", GetNome(i), GetOrgName(i)); SendClientMessage(playerid, -1, str); } else if(Player[i][Cargo] == 5) { new stx[120]; format(stx, sizeof(stx), "Sub-Lнder: %s, Org: %s", GetNome(i), GetOrgName(i)); SendClientMessage(playerid, GetPlayerColor(playerid), stx); } } } return 1; }
if(!strcmp(cmd, "/admins", true) || !strcmp(cmd, "/mods", true) || !strcmp(cmd, "/administradores", true) || !strcmp(cmd, "/moderadores", true))
{
SendClientMessage(playerid, AZUL_BMO, "{FFFFFF}• {00AFCA}Staff's disponнveis:");
new
adml, adm, mdr, hlp, crg
;
foreach(Player, i)
{
if(BMO_GetInt(f(i), "AdminL") == 1)
{
if(aInfo[i][Oculto] == false)
{
adml ++;
format(string, sizeof(string), "~ %s [ID:%d] {1E90FF}Dono", PlayerName(i), i);
SendClientMessage(playerid, -1, string);
}
}
if(aInfo[i][Admin] == 1 && BMO_GetInt(f(i), "AdminL") == 0)
{
if(aInfo[i][Oculto] == false)
{
adm ++;
format(string, sizeof(string), "~ %s [ID:%d] {1E90FF}Administrador", PlayerName(i), i);
SendClientMessage(playerid, -1, string);
}
}
if(aInfo[i][Moderador] == 1 && BMO_GetInt(f(i), "AdminL") == 0)
{
if(aInfo[i][Oculto] == false)
{
mdr ++;
format(string, sizeof(string), "~ %s [ID:%d] {00FF7F}Moderador", PlayerName(i), i);
SendClientMessage(playerid, -1, string);
}
}
if(aInfo[i][Ajudante] == 1 && BMO_GetInt(f(i), "AdminL") == 0)
{
if(aInfo[i][Oculto] == false)
{
hlp ++;
format(string, sizeof(string), "~ %s [ID:%d] {FFA500}Ajudante", PlayerName(i), i);
SendClientMessage(playerid, -1, string);
}
}
if(aInfo[i][Corregedor] == 1 && BMO_GetInt(f(i), "AdminL") == 0)
{
if(aInfo[i][Oculto] == false)
{
crg ++;
format(string, sizeof(string), "~ %s [ID:%d] {00BFFF}Corregedor", PlayerName(i), i);
SendClientMessage(playerid, -1, string);
}
}
}
if(adm == 0 && mdr == 0 && adml == 0 && hlp == 0 && crg == 0) return SendClientMessage(playerid, VERMELHO_BMO, "Nenhum Administrador(a) online no Momento !");
return 1;
}
for(new i; i < GetPlayerPoolSize(); i++)
Use DOF2_GetString para pegar o nome.
O uso de DOF2_GetInt й apenas para pegar nъmeros. |
OrgInfo[i][Lider] = DOF2_GetString(str, "Lider");
CMD:liders(playerid)
{
SendClientMessage(playerid, -1, "* Liders Online");
new count = 0;
foreach(Player, i)
{
if(IsPlayerConnected(i) && OrgInfo[i][Cargo] == 10)
{
format(stx, sizeof(stx), "%s (%d)", Nome(i), i);
SendClientMessage(playerid, -1, stx);
count++;
}
}
if(count == 0)
{
SendClientMessage(playerid, -1, "| INFO | Nгo hб nenhum lнder online no momento!");
}
return 1;
}
for(new i = 0; i < MAX_ORGS; ++i)
{
format(File, sizeof(File), "Org/Org%d.ini", i);
[...] OrgInfo[i][NomeOrg]
}
stock GetOrgName(orgid) { new str[30]; if(orgid == 0) { str = "Civil"; } if(orgid == 1) { str = "Polнcia Militar"; } if(orgid == 2) { str = "Exйrcito"; } if(orgid == 3) { str = "Polнcia Federal"; } if(orgid == 4) { str = "Estado Islвmico"; } if(orgid == 5) { str = "Comando Vermelho"; } if(orgid == 6) { str = "PCC"; } if(orgid == 7) { str = "Famнlia do Norte"; } if(orgid == 8) { str = "Famнlia Groove"; } if(orgid == 9) { str = "Famнlia Ballas"; } if(orgid == 10) { str = "Milнcia"; } return str; }