Formatting strings breaks code: - 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: Formatting strings breaks code: (
/showthread.php?tid=372980)
Formatting strings breaks code: -
ryansheilds - 28.08.2012
I've have this code which is to get player faction information, however when this code is not commented out the statics command stops working and doesn't execute:
pawn Код:
if(PlayerInfo[targetid][pFaction] >= 0) {
format(employer, sizeof(employer), "%s", GroupInfo[pInfo[targetid][pFaction]][fGroupName]);
format(rank, sizeof(rank), "%s", GroupRankInfo[pInfo[targetid][pFaction]][pInfo[targetid][pRank]]);
format(division, sizeof(division), "%s", GroupDivisonInfo[pInfo[targetid][pFaction]][pInfo[targetid][pDivision]]);
}
else {
employer = "None"; division = "None"; rank = "N/A";
}
I debugged it up to this part, when removed the command works when in the command stops working are sometimes returns it as an unknown command - But not always.
EDIT: Fixed, the value was -1 which somehow made the code break.