/members Command
#1

Hey Guys , I Have a Roleplay Server , GM Edit , And I Need the /members Command That will show the Online Family/Faction Members , Can Someone Help Me ?

Here's The Member Code :
Код:
PlayerInfo[playerid][pMember] and PlayerInfo[playerid][pLeader]
Reply
#2

You need to make a boucle.
Код:
SendClientMessage(playerid, Colour, "--------| Member and Stuff |--------");
for(new i; i<MAX_PLAYERS; i++)
{ 
      if(!IsPlayerConnected(i)) return 0;
      if(PlayerInfo[i][pMember] > 0) SendClientMessage(playerid, Colour, Message);
}
SendClientMessage(playerid, Colour, "------------------------------------");
You can add your style
Reply
#3

Removed

Im too tired to provide logical help :/
Reply
#4

PHP код:
dcmd_members(playeridparams[])
{
        new 
amount[2], string[200], shortstr[55], pname[24];
        
SendClientMessage(playerid0xFFFFFFFF"Group members online:");
        for(new 
i=0i<MAX_PLAYERSi++)
        {
                if(
IsPlayerConnected(i))
                {    
                        
amount[0] ++;
                        
amount[1] ++;
                        
GetPlayerName(ipname24);
                        if(
PlayerInfo[playerid][pLeader] != iformat(shortstrsizeof(shortstr), "%s(%d),"pnamex);
                        if(
PlayerInfo[playerid][pLeader] == iformat(shortstrsizeof(shortstr), "[LEADER] %s(%d),"pnamex);
                        if(
amount[1] == 1format(stringsizeof(string), "%s"shortstr);
                        if(
amount[1] != 1format(stringsizeof(string), "%s %s"stringshortstr);
                        if(
amount[0] == 6)
                        {
                           
strdel(stringstrlen(string)-1strlen(string));
                            
SendClientMessage(playerid0xFFFFFFFFstring);
                            
string "";
                            
amount[0] = 0;
                        }    
                }
        }
        
strdel(stringstrlen(string)-1strlen(string));
        if(
amount[0] != 0SendClientMessage(playerid0xFFFFFFFFstring);
        return 
1;

you're welcome
Reply
#5

Quote:
Originally Posted by FilesMAker
Посмотреть сообщение
You need to make a boucle.
Код:
SendClientMessage(playerid, Colour, "--------| Member and Stuff |--------");
for(new i; i<MAX_PLAYERS; i++)
{ 
      if(!IsPlayerConnected(i)) return 0;
      if(PlayerInfo[i][pMember] > 0) SendClientMessage(playerid, Colour, Message);
}
SendClientMessage(playerid, Colour, "------------------------------------");
You can add your style
Returning 0 will break the loop, something we don't want. Use continue; instead. Showing a message is not something the author asked either. You should format a string with the player's name.

I'd make it for you but I don't know how pMember and pLeader work (not a rp fan).
Reply
#6

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Returning 0 will break the loop, something we don't want. Use continue; instead. Showing a message is not something the author asked either. You should format a string with the player's name.

I'd make it for you but I don't know how pMember and pLeader work (not a rp fan).
You are right Konstantinos, You are so skilled on scripting as your Reps says
Reply
#7

pawn Код:
COMMAND:members(playerid)
{
    if(PlayerInfo[playerid][faction] != -1)
    {
        for(new i; i<MAX_PLAYERS; i++)
        {
            if(PlayerInfo[i][faction] != PlayerInfo[playerid][faction]) continue; // Breaks ID if someone isn't in your faction
            if(i == playerid) continue; // Breaks your own ID
            new Strings[250];
            format(Strings, sizeof(Strins), " - %s", PlayerName(i));
            SendClientMessage(playerid, COLOR_WHITE, Strings);
            return 1;
        }
    }
    else return SendClientMessage(playerid, "{ff0000}[ERROR]{ffffff} You cannot use this command");
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)