/fonline command
#5

pawn Код:
if (strcmp( "/fonline", cmdtext, true, 8) == 0)
    {
        new
            string[128],
            p_Name[24]
        ;
        SendClientMessage(playerid, 0xFF0000FF, "* Online Faction Members:");
        for(new u = 0; u < MAX_PLAYERS; u++) { //Looping through all the players, for what? We don't know yet.
            if(gPlayerData[u][Faction] != 0) { //Checking if the looped players are in a faction (I'm assuming you don't use Faction ID zero.
           
                GetPlayerName(u, p_Name, 24); //Max length of SA:MP Nicknames is 24 characters!
               
                format(string, sizeof(string), "[Faction: %d] %s [Rank: %d]", gPlayerData[u][Faction], p_Name, gPlayerData[u][FactionRank]); //Creating the actual message itself, this is where you add their faction id, name, and rank!
                SendClientMessage(playerid, 0xFFFFFF, string); //Send them the specified string!
            }
        }
        return 1;
    }
I have left little comments on things to help you possibly learn.
Reply


Messages In This Thread
/fonline command - by Jordiee - 16.01.2012, 20:41
Re: /fonline command - by milanosie - 16.01.2012, 20:41
Re: /fonline command - by Jordiee - 16.01.2012, 20:48
Re: /fonline command - by Shadow_ - 16.01.2012, 22:26
Re: /fonline command - by 2KY - 16.01.2012, 23:36

Forum Jump:


Users browsing this thread: 5 Guest(s)