Noticias:

Debes de estar registrado para poder ver el contenido indicado. Registrate o Conectate

Menú Principal

Info de la faccion

Iniciado por Swarlog, Feb 04, 2023, 12:49 AM

Tema anterior - Siguiente tema

Swarlog

Información Adicional:

Es un código que encontre y al igual que a mi os puede servir. Con el os informara, mediante un comando, de todos los jugadores conectados de vuestra faction.

Código:

if(strcmp(cmd,"/members",true)==0)
{
new teamnumber;
if (PlayerInfo[playerid][pLeader] != 0) teamnumber = PlayerInfo[playerid][pLeader];
else if (PlayerInfo[playerid][pMember] != 0) teamnumber = PlayerInfo[playerid][pMember];
else if (PlayerInfo[playerid][pFMember] != 255) teamnumber = PlayerInfo[playerid][pFMember];
else
{
SendClientMessage(playerid, COLOR_GRAD1, "You are not a member of an organization!");
return 1;
}
new alevel[25], alevel2[25];
if(PlayerInfo[playerid][pDivision] == 1) { alevel = "TNR"; }
else if(PlayerInfo[playerid][pDivision] == 2) { alevel = "CID"; }
else if(PlayerInfo[playerid][pDivision] == 3) { alevel = "HSIU"; }
else if(PlayerInfo[playerid][pDivision] == 4) { alevel = "SWAT"; }
else if(PlayerInfo[playerid][pDivisionLeader] == 1) { alevel2 = "TNR"; }
else if(PlayerInfo[playerid][pDivisionLeader] == 2) { alevel2 = "CID"; }
else if(PlayerInfo[playerid][pDivisionLeader] == 3) { alevel2 = "HSIU"; }
else if(PlayerInfo[playerid][pDivisionLeader] == 4) { alevel2 = "SWAT"; }

SendClientMessage(playerid, 0x808000AA, "Members Online:");
foreach (Player, i)
{
if (IsPlayerConnected(i))
{
GetPlayerRPName(i, sendername, sizeof(sendername));
format(string, sizeof(string), "");
if(PlayerInfo[playerid][pLeader] || PlayerInfo[playerid][pMember])
{
if (PlayerInfo[i][pLeader] == teamnumber && PlayerInfo[i][pDivisionLeader])
{
format(string, sizeof(string), "%s (Leader), Division: %s",sendername, alevel2);
}
else if (PlayerInfo[i][pLeader] == teamnumber && PlayerInfo[i][pDivisionLeader])
{
format(string, sizeof(string), "%s (Leader)",sendername);
}
else if (PlayerInfo[i][pMember] == teamnumber && PlayerInfo[i][pDivision] != 0)
{
format(string, sizeof(string), "%s, Rank: %d, Division: %s",sendername, PlayerInfo[i][pRank], alevel);
}
else if (PlayerInfo[i][pMember] == teamnumber && PlayerInfo[i][pDivision] == 0)
{
format(string, sizeof(string), "%s, Rank: %d.",sendername, PlayerInfo[i][pRank]);
}
}
else if(PlayerInfo[playerid][pFMember] != 255)
{
if (PlayerInfo[i][pFMember] == teamnumber)
{
format(string, sizeof(string), "%s, Rank: %d.",sendername, PlayerInfo[i][pRank]);
}
}
if (strlen(string) > 1) SendClientMessage(playerid, 0xF5DEB3AA, string);
}
}
}