tag mismatch error +rep for helper
#8

The reason it's tag mismatching is because the last two variables (for the cars colour) are untagged integers, and the array is defined as an array of elements with the float tag. To fix this, you'd have to assign an enum (because there are mixed tags within the array), and refer to the elements accordingly. Replace your code for creating the array with this:

pawn Код:
//Enumeration for spawn data for elegies.
enum ELEGY_SPAWN_DATA
{
    /* Float tagged variables */
    Float:X,
    Float:Y,
    Float:Z,
    Float:ZRot,
   
    /* Untagged variables */
    _:Col1,
    _:Col2,
}

//Create a new array, infinite amount of elements and with the ELEGY_SPAWN_DATA enum, to define what types we have in there.
new elegies[ ][ ELEGY_SPAWN_DATA ] =
{
    {-1614.635131, 1007.885314, 6.847799, 250.569107, 17, 1 }
    //...
};
To assign stuff to the newly defined array, you'd can use the enums variables.. it just looks neater I guess.

pawn Код:
elegies[ i ][ Col1 ] = 1;

//.. is the same as ..

elegies[ i ][ 5 ] = 1;
So this would mean your function for spawning elegies might look something like this:

pawn Код:
public Spawnelegies()
{
    for(new i=0; i<20; i++)
    {
        elegy[i] = AddStaticVehicle(562,elegies[i][X],elegies[i][Y],elegies[i][Z],elegies[i][ZRot],elegies[i][Col1],elegies[i][Col2]);
        SetVehicleVirtualWorld(elegy[i],0);
    }
    return 1;
}
Reply


Messages In This Thread
tag mismatch error +rep for helper [SOLVED] - by Danyal - 26.12.2011, 06:08
Re: tag mismatch error +rep for helper - by §с†¶e®РµРe - 26.12.2011, 06:13
Re: tag mismatch error +rep for helper - by Danyal - 26.12.2011, 06:19
Re: tag mismatch error +rep for helper - by Thresholdold - 26.12.2011, 06:38
Re: tag mismatch error +rep for helper - by blewert - 26.12.2011, 06:41
Re: tag mismatch error +rep for helper - by Definition - 26.12.2011, 07:15
Re: tag mismatch error +rep for helper - by Danyal - 26.12.2011, 07:22
Re: tag mismatch error +rep for helper - by blewert - 26.12.2011, 09:04

Forum Jump:


Users browsing this thread: 1 Guest(s)