13.08.2013, 17:34
Okay, so here's the deal. I am trying to dynamically list the characters in a faction and put them into a text draw. I ended up with this sliver of code:
Notice the commented line? Whenever that line is there, the text-draw doesn't show up. However, when I remove it, it works absolutely fine. I don't see a problem with this though because the text-draw only has (at this point) 2 color codes in it.
Does anyone have any idea why the commented line of code (basically) disables the text draw?
pawn Code:
new
szString[150],
szFirstName[2],
szMainString[1000];
foreach(new iTarget : Player)
{
if(IsPlayerInFactionID(iTarget, pStats[playerid][iPlayerFaction][i]))
{
strmid(szFirstName, pStats[iTarget][pFirstName], 0, 1);
format(szString, sizeof(szString), "~y~%s. %s", szFirstName, pStats[iTarget][pLastName]);
strcat(szMainString, szString);
strcat(szMainString, "~w~, "); // this is the problem line
}
}
strins(szMainString, "Online Members: ", 0);
PlayerTextDrawSetString(playerid, textPlayerFactionList[2], szMainString);
Does anyone have any idea why the commented line of code (basically) disables the text draw?