Labels load with bad pos.
#1

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:

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
Here is the code when the labels load:

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;
}
Reply
#2

someone can help me please ? this is urgent.
Reply
#3

Must be
unformat(Line, "p<,>fffs[128]",LX,LY,LZ,LabelInfo);
Reply
#4

Now labels dont load !! Anyone can help me please ? Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)