[Help] Command: /amembers
#4

This command is poorly scripted.

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)
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
.
Reply


Messages In This Thread
[Help] Command: /amembers - by Maxx- - 09.12.2009, 13:15
Re: [Help] Command: /amembers - by DJDhan - 09.12.2009, 15:04
Re: [Help] Command: /amembers - by Maxx- - 09.12.2009, 15:09
Re: [Help] Command: /amembers - by Joe Staff - 09.12.2009, 17:20
Re: [Help] Command: /amembers - by Maxx- - 10.12.2009, 13:05
Re: [Help] Command: /amembers - by Joe Staff - 10.12.2009, 18:51

Forum Jump:


Users browsing this thread: 1 Guest(s)