Need help with with faction list
#1

Idk if I did correct.. but yeah something ain't working well maybe someone could kelp...

pawn Код:
CMD:factions(playerid, params[])
{
        new string[128];
    PlayerInfo[id][pFaction]
    for(new i = 0; i < sizeof(PlayerInfo); i++)
    {
        if(PlayerInfo[i][bizOn])
        {
            format(string, sizeof(string), "66FF66}%s" ,string, i, PlayerInfo[i][pFaction]);
        }
    }
    return 1;
}
Reply
#2

Show us your faction and PlayerInfo Enumerator please, we might help you if you do show it.
Reply
#3

Something ain't working? WHAT THE FUCK ARE YOU TRYING TO DO? TELL US GODDAMIT
Reply
#4

pawn Код:
enum p_Info
{
    pFaction,
}
new PlayerInfo[MAX_PLAYERS][p_Info];



enum FACTION_INFO
{
    fID,
    fPickUp,
    fName[50],
Sorry for late answer..
Reply
#5

What exactly do you want the command to do?

Return the names of every faction?
Reply
#6

Show us your Faction Enumerator, I do see the problem, your assigning your variable wrong

pawn Код:
for(new i = 0; i < sizeof(PlayerInfo); i++)//yours | wrong
//should look something like this
 for(new i; i< MAX_FACTIONS; i++)
Reply
#7

Btw big thanks guys for help.. just first time making something like this..

pawn Код:
enum FACTION_INFO
{
    fID,
    fPickUp,
    fName[50],
    Float:fX,
    Float:fY,
    Float:fZ,
    fSpawnInt,
    fRank1[35],
    fRank2[35],
    fRank3[35],
    fRank4[35],
    fRank5[35],
    fRank6[35],
    fRank7[35],
    fRank8[35],
    fRank9[35],
    fRank10[35],
    fRank11[35],
    fRank12[35],
    fRank13[35],
    fRank14[35],
    fRank15[35],
    fRank16[35],
    fRank17[35],
    fRank18[35],
    fRank19[35],
    fRank20[35],
    fJoinRank,
    fType,
    fRankAmount,
    fChatON,
    fColor,
    fLeaderRank,
    Float:fUniformX,
    Float:fUniformY,
    Float:fUniformZ,
    fON
};
new Factions[MAX_FACTIONS][FACTION_INFO];
Reply
#8

Here you go

pawn Код:
CMD:factions(playerid, params[])
{
    new
        string [ 50 ]
    ;
    for(new i; i < MAX_FACTIONS; i++) return
        format(string, sizeof(string), "{66FF66}%s" ,string, i, Factions[i][fName]), SendClientMessage(playerid, -1, string);
    return 1;
}
SendClientMessage would show something like this: {66FF66}Los Santos Police Department
Reply
#9

Big thanks mate +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)