09.12.2009, 17:20
This command is poorly scripted.
As I rebuilt your command I found your problem
As you can see you're checking if the player that typed the command is a member of the group, not if the player in the loop is a member of the group
.
pawn Код:
if(!strcmp(cmdtext[1],"amembers",true,8))
{
if(PlayerInfo[playerid][Admin]<1)return SendClientMessage(playerid, COLOR_GRAD1, "You are not autorized to use this command!");
if(!cmdtext[10])return SendClientMessage(playerid,COLOR_WHITE,"USA: /aMembers [Faction Number]");
if(strval(cmdtext[10])>MAXIMUM)return SendClientMessage(playerid,COLOR_WHITE,"USA: /aMembers <1-MAXIMUM>"); //Change MAXIMUM to the highest faction number
new tempstr[128];
new tempint = strval(cmdtext[10]);
format(tempstr,sizeof(tempstr),"- Members Online in Faction %d",tempint);
SendClientMessage(playerid,0x808000FF,tempstr);
for(new player; player<MAX_PLAYERS; player++)
{
if(!IsPlayerConnected(player))continue;
if((PlayerInfo[player][pMember]==tempint)||(PlayerInfo[player][pLeader]==tempint))
{
GetPlayerName(player,tempstr,sizeof(tempstr));
SendClientMessage(playerid,COLOR_LIGHTRED,tempstr);
}
}
return 1;
}
As I rebuilt your command I found your problem
pawn Код:
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
.