02.02.2012, 19:41
Hey, i have a system for make labels in game, and load from a .txt, but my problem is what the pos of the labels are bugged when they load, example, i have this in the txt:
Here is the code when the labels load:
pawn Код:
123.451, 12.2, 0.5, This is a test label 1//
1253.4551, 2612.2, 1.5, This is a test label 2 //the label 2 are in the same pos what label 1
pawn Код:
stock AgregarLabels(LFileName[])
{
if(!fexist(LFileName)) return 0;
new File:LFile, Line[128], LabelInfo[128], Float:LX, Float:LY, Float:LZ, lTotal = 0;
LFile = fopen(LFileName, io_read);
while(fread(LFile, Line))
{
if(Line[0] == '/' || isnull(Line)) continue;
unformat(Line, "p<,>s[128]fff", LabelInfo,LX,LY,LZ);
//CreateDynamic3DTextLabel(LabelInfo, COLOR_LIGHTGREEN, LX, LY, LZ, 100.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
//ForRndColorLabel
CreateDynamic3DTextLabel(LabelInfo, ForRndColorLabel[random(sizeof(ForRndColorLabel))], LX, LY, LZ, 100.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
lTotal++;
}
fclose(LFile);
return lTotal;
}