Help Tag MisMatch
#1

Hi,

I have a problem loading the toys from the account of a user with respect to dini_FloatSet ...

Quote:

warning 213: tag mismatch

For:

Quote:

for(new v = 0; v < MAX_PLAYERTOYS; v++)
{
new string[128];
format( string, sizeof( string ), "pt%dModelID", v);
dini_Int(string, PlayerToyInfo[playerid][v][ptModelID]);
format(string, 128, "pt%dBone",v);
dini_Int(string, PlayerToyInfo[playerid][v][ptBone]);
format(string, 128, "pt%dPosX",v);
dini_Float(string, PlayerToyInfo[playerid][v][ptPosX]); This
format(string, 128, "pt%dPosY",v);
dini_Float(string, PlayerToyInfo[playerid][v][ptPosY]); This
format(string, 128, "pt%dPosZ",v);
dini_Float(string, PlayerToyInfo[playerid][v][ptPosZ]); This
format(string, 128, "pt%dRotX",v);
dini_Float(string,PlayerToyInfo[playerid][v][ptRotX]); This
format(string, 128, "pt%dRotY",v);
dini_Float(string,PlayerToyInfo[playerid][v][ptRotY]); This
format(string, 128, "pt%dRotZ",v);
dini_Float(string,PlayerToyInfo[playerid][v][ptRotZ]); This
format(string, 128, "pt%dSizX",v);
dini_Float(string,PlayerToyInfo[playerid][v][ftscaleX]); This
format(string, 128, "pt%dSizY",v);
dini_Float(string,PlayerToyInfo[playerid][v][ftscaleY]); This
format(string, 128, "pt%dSizZ",v);
dini_Float(string,PlayerToyInfo[playerid][v][ftscaleZ]); This
}

Besides the already defined Float with enum ptInfo Float: ...

dini_Int(filename[], key[]) = dini_Float(filename[], key[]) with decimal

Help me please

From already thank you very much.
Reply
#2

Post your PlayerToyInfo enum.
Reply
#3

Quote:

enum ptInfo
{
ptModelID,
ptBone,
FloattPosX,
FloattPosY,
FloattPosZ,
FloattRotX,
FloattRotY,
FloattRotZ,
Float:ftscaleX,
Float:ftscaleY,
Float:ftscaleZ
};

Help please
Reply
#4

Don't use quote use [pawn][pawn]
Reply
#5

Oh, i'm sorry

pawn Код:
enum ptInfo
{
    ptModelID,
    ptBone,
    Float:ptPosX,
    Float:ptPosY,
    Float:ptPosZ,
    Float:ptRotX,
    Float:ptRotY,
    Float:ptRotZ,
    Float:ftscaleX,
    Float:ftscaleY,
    Float:ftscaleZ
};
Reply
#6

Maybe this will help ?
pawn Код:
for(new v = 0; v < MAX_PLAYERS; v++)
        {
            new string[128];
            format( string, sizeof( string ), "pt%dModelID", v);
            dini_Int(string, PlayerToyInfo[playerid][v][ptModelID]);
            format(string, 128, "pt%dBone",v);
            dini_Int(string, PlayerToyInfo[playerid][v][ptBone]);
            format(string, 128, "pt%dPosX",v);
            float:dini_Float(string, PlayerToyInfo[playerid][v][ptPosX]);
            format(string, 128, "pt%dPosY",v);
            float:dini_Float(string, PlayerToyInfo[playerid][v][ptPosY]);
            format(string, 128, "pt%dPosZ",v);
            float:dini_Float(string, PlayerToyInfo[playerid][v][ptPosZ]);
            format(string, 128, "pt%dRotX",v);
            float:dini_Float(string,PlayerToyInfo[playerid][v][ptRotX]);
            format(string, 128, "pt%dRotY",v);
            float:dini_Float(string,PlayerToyInfo[playerid][v][ptRotY]);
            format(string, 128, "pt%dRotZ",v);
            float:dini_Float(string,PlayerToyInfo[playerid][v][ptRotZ]);
            format(string, 128, "pt%dSizX",v);
            float:dini_Float(string,PlayerToyInfo[playerid][v][ftscaleX]);
            format(string, 128, "pt%dSizY",v);
            float:dini_Float(string,PlayerToyInfo[playerid][v][ftscaleY]);
            format(string, 128, "pt%dSizZ",v);
            float:dini_Float(string,PlayerToyInfo[playerid][v][ftscaleZ]);
        }
Reply
#7

dini_Float(string, PlayerToyInfo[playerid][v][ptPosX]);

All positions should be Floats not strings. It's defined as Float, you can't load Floats from string "Texts" I think .. Just try floats instead
pawn Код:
new Float:Posx or whatever ..
Reply
#8

I do not understand... :/
Reply
#9

pawn Код:
stock dini_Int(filename[],key[]) {
   return strval(dini_Get(filename,key));
}

stock Float:dini_Float(filename[],key[]) {
   return floatstr(dini_Get(filename,key));
}
That's from the dini include. You're doing it wrong.

First parameter is not for the key, is for the file to load the info from, second parameter is for the key, or what you have formatted in 'string'.

PlayerToyInfo[playerid][v][ftscaleZ] = dini_Float(file, string);

Should work if you use that in all fields (including the integer ones); The result is not stored in the second variable, it's returned by the function itself.
Reply
#10

Do you have to be like then?

pawn Код:
for(new v = 0; v < MAX_PLAYERTOYS; v++)
    {
        new string[128];
        format( string, sizeof( string ), "pt%dModelID", v);
        PlayerToyInfo[playerid][v][ptModelID] = dini_Int(file, string);
....
....
....
EDIT: dini_Float for dini_Init because the number is integer and the others are with dini_Float because they would decimals ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)