Problema al cargar labels de .txt
#1

Miren, tengo un sistema de labels que se guardan en un .txt y se cargan desde un .txt, en la 0.3d me andaba todo bien, y ahora en la 0.3d R2, se bugean, osea algunos estan en otra posicion de otro label encima de otro, y no deberia estar ahi. Tengo el streamer y sscanf todo bien actualizado, nose que pasa. Aca les dejo el stock.



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;
}
Ven algo mal ? :_ nose que puede ser.... Si nesesitan otro dato del script diganme.
Reply
#2

Mmm... Es extraсo, a mi me parece que estб todo bien. =/
Voy a verificarlo mбs profundamente.
Reply
#3

Si yo tambien, veo todo bien, tengo todo actualizado, nose que pasa. Mira aca te dejo un ejemplo del bug:
en el txt :
pawn Код:
123.451, 12.2, 0.5, label test 1//
1253.4551, 2612.2, 1.5, label test 2  // el label 2 aparece en la misma posicion que el label 1.
Igualmente, esto NO PASA CON TODOS LOS LABELS, solo con algunos digamos 2 de cada 10.
Reply
#4

Revivo, por favor, alguien tiene idea de por que pasa ?
Reply
#5

Pasa un ejemplo de linea de label pero uno que tengas hecho no inventado
Reply
#6

Mira aca tengo unos cuantos:

Код:
NORTE: Las Venturas Port Island,3900.84,4635.55,6.30
SUR: Las Venturas - Long, Duck Islands,3921.94,4598.49,11.00
Bienvenido a Stradlin Island,3937.29,4597.13,11.44
SUR: Las Venturas,2354.50,7046.00,11.04
NORESTE: LV Port Island,865.68,2487.67,35.63
Duck - Long - Stradlin Islands,2736.70,1981.36,13.73
ESTE: Duck - Long - Stradlin Islands,2860.21,2130.16,17.82
ATENCION: Peaje,4786.90,2197.44,11.64
OESTE: Las Venturas,4797.53,2204.99,17.67
SUR: Long Island - Stradlin Island,4908.37,2185.59,18.02
NOROESTE: Duck Island - Las Venturas,5560.68,-402.98,14.06
SUR: Feirth Island - Los Santos,5600.09,-424.09,14.06
Long Island - Stradlin Island,5649.47,-415.53,14.06
OESTE: Feirth Island - Duck Island - Las venturas,6666.90,-417.83,17.92
OESTE: Stradlin Island,6762.45,-203.00,17.84
SURESTE: Stradlin - Long - Duck Island,2432.24,7111.54,11.37
Algunos que otros se bugean y van a la posicion de otro :/ nose que carajos pasa xd
Reply
#7

pawn Код:
stock AgregarLabels(LFileName[])
{
    if(!fexist(LFileName)) return 0;

    new File:LFile = fopen(LFileName, io_read),
        Line[128],
        LabelInfo[128],
        Float:LX,
        Float:LY,
        Float:LZ,
        lTotal = 0;

    while(fread(LFile, Line))
    {
        if(!unformat(Line, "p<,>s[128]fff", LabelInfo,LX,LY,LZ))
        {
            CreateDynamic3DTextLabel(LabelInfo, ForRndColorLabel[random(sizeof(ForRndColorLabel))], LX, LY, LZ, 100.0);
            lTotal++;
        }
    }

    fclose(LFile);
    return lTotal;
}
Reply
#8

Ea, ahi me anda joya, gracias.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)