Tag Mismatch Warning
#1

I have a tag mismatch warning but the script works fine. I just need to know what to edit:

pawn Код:
enum zoneinfo {
    zone_name[27],
    Float:zone_minx,
    Float:zone_miny,
    Float:zone_minz,
    Float:zone_maxx,
    Float:zone_maxy,
    Float:zone_maxz
}

new Float:zones[][zoneinfo] = {
{ "LV Drug House (Int)",     2363.7732,  -1135.5873,    1050.8750,  2366.7190,  -1125.8083,  1050.8826},
{ "Alcatraz",                3539.1328,  382.3327,    -5.0000,  4085.4063,  560.8972,   500.5000},
{ "Alcatraz (Int)",          240.3424,  107.4418,    998.0156,  260.3839,  119.8392,   1008.8303},
{ "Alcatraz (Int)",          213.9791,  107.4416,    999.0100,  229.0557,  116.0217,   999.0180}};
pawn Код:
public OnGameModeInit();
{
        for(new i; i < sizeof(zones); i++)
        {
            format(TeleMenuString,sizeof(TeleMenuString),"%s\n%s",TeleMenuString,zones[i][0]); //warning
        }
return 1;
}
It works tho. TeleMenuString contains the zone_name (as I wanted) but there is the warning. The warning is because of zones[i][0].
Reply
#2

pawn Код:
new Float:zones[][zoneinfo] = {
    { "LV Drug House (Int)",     2363.7732,  -1135.5873,    1050.8750,  2366.7190,  -1125.8083,  1050.8826},
    { "Alcatraz",                3539.1328,  382.3327,    -5.0000,  4085.4063,  560.8972,   500.5000},
    { "Alcatraz (Int)",          240.3424,  107.4418,    998.0156,  260.3839,  119.8392,   1008.8303},
    { "Alcatraz (Int)",          213.9791,  107.4416,    999.0100,  229.0557,  116.0217,   999.0180}
};
The data type is float and I believe you cannot assign string to a float data type.
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
Use "zone_name" not "0".
Thanks ******! But can you explain why so? I must register this one in my pawn experience vault. ^^
Reply
#4

Warnings don't always prevent your script from working. Sometimes it just means your code doesn't follow standards.
Reply
#5

Remove the Float: tag from the array.
Reply
#6

Quote:
Originally Posted by Vince
Посмотреть сообщение
Remove the Float: tag from the array.
Thanks to you too. It's touching seeing so many experienced scripters helping me out...
Fixed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)