SA-MP Forums Archive
What's wrong with this? (null) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: What's wrong with this? (null) (/showthread.php?tid=504108)



What's wrong with this? (null) - RedCounty - 02.04.2014

pawn Код:
stock GetFactionRank(playerid)
{
    new rank[24];
    if(Player[playerid][FactionRank] == 0)rank = "n/a";
    else if(Player[playerid][FactionRank] == 1)format(rank, sizeof(rank), "%s", Factions[Player[playerid][Faction]][RankOne]);
    else if(Player[playerid][FactionRank] == 2)format(rank, sizeof(rank), "%s", Factions[Player[playerid][Faction]][RankTwo]);
    else if(Player[playerid][FactionRank] == 3)format(rank, sizeof(rank), "%s", Factions[Player[playerid][Faction]][RankThree]);
    else if(Player[playerid][FactionRank] == 4)format(rank, sizeof(rank), "%s", Factions[Player[playerid][Faction]][RankFour]);
    else if(Player[playerid][FactionRank] == 5)format(rank, sizeof(rank), "%s", Factions[Player[playerid][Faction]][RankFive]);
    else if(Player[playerid][FactionRank] == 6)format(rank, sizeof(rank), "%s", Factions[Player[playerid][Faction]][RankSix]);
    else if(Player[playerid][FactionRank] == 7)format(rank, sizeof(rank), "%s", Factions[Player[playerid][Faction]][RankSeven]);
    return rank;
}
returns "(null)" when I print it out.

pawn Код:
print(GetFactionRank(playerid));



Re: What's wrong with this? (null) - RedCounty - 02.04.2014

Nevermind, fixed - Issue for others who may get this: Not loading the data correctly from the MySQL database - sorry for the slight mishap.