[Help] Spam of warnings, tuuuhhh... -
LetsOWN[PL] - 29.05.2011
Hello.
T'day I was working with random spawns.
Everything's okey, but I receiving the following warning:
warning 213: tag mismatch
It's in lines 1131 -> 1135
Here are these lines:
pawn Код:
// {posX, posY, posZ, rot}
new Float:BattleFieldSpawns[4][4] = {
{-1132.9099, 1051.1733, 1346.1875, 90},
{-1130.3378, 1059.2005, 1346.1573, 90},
{-1126.56713867, 1092.78271484, 1345.50048828, 90},
{-1129.30297852, 1052.89721680, 1345.47644043, 90}};
Any suggestions?
Re: [Help] Spam of warnings, tuuuhhh... -
MetalScript - 29.05.2011
Try this way:
pawn Код:
new Float:BattleFieldSpawns[][4] =
{
{-1132.9099, 1051.1733, 1346.1875, 90},
{-1130.3378, 1059.2005, 1346.1573, 90},
{-1126.56713867, 1092.78271484, 1345.50048828, 90},
{-1129.30297852, 1052.89721680, 1345.47644043, 90}
};
and then
pawn Код:
new rand = random(sizeof(BattleFieldSpawns));
SetPlayerPos(playerid, BattleFieldSpawns[rand][0], BattleFieldSpawns[rand][1],BattleFieldSpawns[rand][2]);
SetPlayerFacingAngle(playerid, BattleFieldSpawns[rand][3]);
Re: [Help] Spam of warnings, tuuuhhh... -
LetsOWN[PL] - 29.05.2011
pawn Код:
new rand = random(sizeof(BattleFieldSpawns));
SetPlayerPos(playerid, BattleFieldSpawns[rand][0], BattleFieldSpawns[rand][1],BattleFieldSpawns[rand][2]);
SetPlayerFacingAngle(playerid, BattleFieldSpawns[rand][3]);
I did it already, before posting

Anyway thanks. Well, everything is fine, even with these warnings, but.. warnings are annoying.. Thanks, I'll try this.
Re: [Help] Spam of warnings, tuuuhhh... -
blewert - 29.05.2011
The 4th variable was an untagged integer in a
Float tagged array. You need to convert the untagged integer to a tagged
Float. I imagine if you're setting the players rotation, it needs to be a float anyways so just add '.0' to the end of it:
PHP код:
new Float:BattleFieldSpawns[ 4 ][ 4 ] =
{
{ -1132.9099, 1051.1733, 1346.1875, 90.0 },
{ -1130.3378, 1059.2005, 1346.1573, 90.0 },
{ -1126.56713867, 1092.78271484, 1345.50048828, 90.0 },
{ -1129.30297852, 1052.89721680, 1345.47644043, 90.0 }
};
or change the tag:
PHP код:
new Float:BattleFieldSpawns[ 4 ][ 4 ] =
{
{ -1132.9099, 1051.1733, 1346.1875, Float:90 },
{ -1130.3378, 1059.2005, 1346.1573, Float:90 },
{ -1126.56713867, 1092.78271484, 1345.50048828, Float:90 },
{ -1129.30297852, 1052.89721680, 1345.47644043, Float:90 }
};
.. or even use
float():
PHP код:
new Float:BattleFieldSpawns[ 4 ][ 4 ] =
{
{ -1132.9099, 1051.1733, 1346.1875, float(90) },
{ -1130.3378, 1059.2005, 1346.1573, float(90) },
{ -1126.56713867, 1092.78271484, 1345.50048828, float(90) },
{ -1129.30297852, 1052.89721680, 1345.47644043, float(90) }
};
All are valid and should work.
If you
really need to convert it to an integer again, use
floatround.
Re: [Help] Spam of warnings, tuuuhhh... -
LetsOWN[PL] - 29.05.2011
Works

Thank you.