tag mismatch error +rep for helper
#1

SOLVED
Reply
#2

Hey man it's a warning.Your script has been compiled and even after this if InGame something is wrong then tell us...:S
Reply
#3

yea its working +rep. but is there any way so that i dont get them
Reply
#4

Do you have
pawn Код:
new Float:elegies[20][6]
in your script?
Reply
#5

What's the definition for the arrays 'elegy' and 'elegies'? The warning is because either:

The array elegy could be a float tagged array, and you are trying to pass an untagged integer value to it, thus causing a warning.

or

elegies[i][1], elegies[i][2] and elegies[i][3] are untagged integers and you could be referencing to them as floats rather than untagged integers, thus creating a warning.

or

elegies[i][4] and elegies[i][5] are floats, and you could be referencing to them as untagged integers, thus creating a warning.

Either one could be sorted if you posted the region of code where you initialized these arrays to hold these values in.
Reply
#6

I would help... but you DDoS'd our server, so GTFO.
Reply
#7

now another dumb shit all are saying that i ddos every server
well if somebody dont want to help go i dont need your help there are more person that can help me


SOLVED
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)