22.03.2014, 20:22
Well, on my RP server I have a command that is /members. Then all the members in your family should pop up, but instead it says like "Members Online
Austin: Rank 6
Austin: Rank 2
Austin: Rank 4"
So how to set so the player names instead of my name pops up?
Here is my code.
Austin: Rank 6
Austin: Rank 2
Austin: Rank 4"
So how to set so the player names instead of my name pops up?
Here is my code.
pawn Код:
CMD:members(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
new string[128];
new sendername[MAX_PLAYER_NAME];
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;
}
SendClientMessage(playerid, 0x808000AA, "Members Online:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "");
if(PlayerInfo[playerid][pLeader] || PlayerInfo[playerid][pMember])
{
if (PlayerInfo[i][pLeader] == teamnumber)
{
format(string, sizeof(string), "%s (Leader)",sendername);
}
else if (PlayerInfo[i][pMember] == teamnumber)
{
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);
}
}
}
return 1;
}