Players Faction Online
#5

Quote:
Originally Posted by Abagail
Посмотреть сообщение
Maybe something like this?

pawn Код:
stock GetFacCount(fid)
{
    new count;
    foreach(Player, i) {
     if(pInfo[i][pFaction] == fid) count++;
     return count; }
    return 0;
}
Untested.
Yes, to show the number of connected members of that faction. although it would be good to add IsPlayerConnected.

Other example.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/polices", cmdtext, true, 10) == 0)
    {
        new string[32], name[24];
        SendClientMessage(playerid, -1, "Active members.");
        foreach(Player,i)
        {
            if(IsPlayerConnected(i))
            {
                if(PlayerInfo[i][Faction] == FACTIONID)
                {
                    GetPlayerName(i, name, 24), format(string, sizeof(string), "%s", name);
                    if(strlen(string) > 0) SendClientMessage(playerid, -1, string);
                }
            }
        }
        return 1;
    }
    return 0;
}
Reply


Messages In This Thread
Players Faction Online - by Steveproxy5 - 02.08.2014, 21:01
Re: Players Faction Online - by babecka - 02.08.2014, 21:03
Re: Players Faction Online - by Steveproxy5 - 02.08.2014, 21:10
Re: Players Faction Online - by Abagail - 02.08.2014, 21:13
Respuesta: Re: Players Faction Online - by Zume - 02.08.2014, 21:24
Re: Players Faction Online - by Steveproxy5 - 02.08.2014, 21:29
Respuesta: Re: Players Faction Online - by Zume - 02.08.2014, 21:40
Re: Players Faction Online - by Steveproxy5 - 02.08.2014, 22:11

Forum Jump:


Users browsing this thread: 1 Guest(s)