Faction Rank Names aren't loading.
#1

Could someone help me as to why my faction ranks aren't loading?

pawn Код:
forward LoadFactions_Faction(facid,name[],value[]);
public LoadFactions_Faction(facid,name[],value[])
{
    INI_String("Name", FacInfo[facid][fName], 35);
    INI_Float("IntX", FacInfo[facid][IntX]);
    INI_Float("IntY", FacInfo[facid][IntY]);
    INI_Float("IntZ", FacInfo[facid][IntZ]);
    INI_Float("ExtX", FacInfo[facid][ExtX]);
    INI_Float("ExtY", FacInfo[facid][ExtY]);
    INI_Float("ExtZ", FacInfo[facid][ExtZ]);
    INI_Int("Interior", FacInfo[facid][fInterior]);
    INI_String("Rank1", FacInfo[facid][fRank1], 24);
    INI_String("Rank2", FacInfo[facid][fRank2], 24);
    INI_String("Rank3", FacInfo[facid][fRank3], 24);
    INI_String("Rank4", FacInfo[facid][fRank4], 24);
    INI_String("Rank5", FacInfo[facid][fRank5], 24);
    INI_String("Rank6", FacInfo[facid][fRank6], 24);
    INI_Int("Type", FacInfo[facid][fType]);
    INI_Int("Vault", FacInfo[facid][fVault]);
    INI_Int("Materials", FacInfo[facid][fMaterials]);
    INI_Int("Weed", FacInfo[facid][fWeed]);
    INI_Int("Cocaine", FacInfo[facid][fCocaine]);
    return 1;
}
This is my callback of getting the faction ranks.
Код:
GetFactionRank(playerid)
{
    new string[24];
    switch(PlayerInfo[playerid][pFactionRank])
    {
        case 1: format(string, sizeof(string), "%s", FacInfo[PlayerInfo[playerid][pFaction]][fRank1]);
        case 2: format(string, sizeof(string), "%s", FacInfo[PlayerInfo[playerid][pFaction]][fRank2]);
        case 3: format(string, sizeof(string), "%s", FacInfo[PlayerInfo[playerid][pFaction]][fRank3]);
        case 4: format(string, sizeof(string), "%s", FacInfo[PlayerInfo[playerid][pFaction]][fRank4]);
        case 5: format(string, sizeof(string), "%s", FacInfo[PlayerInfo[playerid][pFaction]][fRank5]);
        case 6: format(string, sizeof(string), "%s", FacInfo[PlayerInfo[playerid][pFaction]][fRank6]);
        default: string = "None";
    }
    return string;
}
Reply
#2

Anyone?
Reply
#3

I use MySQL and its pretty much the same way as i do it myself, i don't see a problem at first glance.

pawn Код:
stock RetriveFactionRankName(playerid)
{
    new PlayerRank[64];
    switch(CharacterInfo[playerid][FactionRank])
    {
        case 1: { format(PlayerRank,sizeof(PlayerRank), "%s", FactionInfo[CharacterInfo[playerid][FactionID]][Rank_One]); }
        case 2: { format(PlayerRank,sizeof(PlayerRank), "%s", FactionInfo[CharacterInfo[playerid][FactionID]][Rank_Two]); }
        case 3: { format(PlayerRank,sizeof(PlayerRank), "%s", FactionInfo[CharacterInfo[playerid][FactionID]][Rank_Three]); }
        case 4: { format(PlayerRank,sizeof(PlayerRank), "%s", FactionInfo[CharacterInfo[playerid][FactionID]][Rank_Four]); }
        case 5: { format(PlayerRank,sizeof(PlayerRank), "%s", FactionInfo[CharacterInfo[playerid][FactionID]][Rank_Five]); }
        case 6: { format(PlayerRank,sizeof(PlayerRank), "%s", FactionInfo[CharacterInfo[playerid][FactionID]][Rank_Six]); }
        case 7: { format(PlayerRank,sizeof(PlayerRank), "%s", FactionInfo[CharacterInfo[playerid][FactionID]][Rank_Seven]); }
        case 8: { format(PlayerRank,sizeof(PlayerRank), "%s", FactionInfo[CharacterInfo[playerid][FactionID]][Rank_Eight]); }
        case 9: { format(PlayerRank,sizeof(PlayerRank), "%s", FactionInfo[CharacterInfo[playerid][FactionID]][Rank_Nine]); }
    }
    return PlayerRank;
}
Reply
#4

Hm, I think with YINI you have to save as a string and load as an interger. Not sure tho!
Reply
#5

Anyone?
Reply
#6

Quote:

No Double Posting - There is a modify button , use it. However, bumping a topic in which you have or require further information is allowed after at least 24 hours.

Read the forum rules.

I don't even understand what your issue is, what do you mean "loading"?
Reply
#7

Hmmm can you post your saving for factions and also make sure that 'FactionRank' has parameters like
pawn Код:
enum hi {factionrank[32]};
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)