Why do I get those warnings? -
nuriel8833 - 21.04.2011
Hello everyone.
I was making a tiny command but whenever I compile my server I get 3 warnings:
PHP Code:
warning 213: tag mismatch
warning 213: tag mismatch
warning 213: tag mismatch
For the command I made (the warnings are in line 4):
PHP Code:
if(strcmp(cmdtext,"/kill",true) == 0){
GetPlayerPos(playerid,spawnX[playerid],spawnY[playerid],spawnZ[playerid]);
for(new i=0; i<sizeof(spawnInfo); i++){
if(spawnInfo[i][0] == spawnX[playerid] && spawnInfo[i][1] == spawnY[playerid] && spawnInfo[i][2] == spawnZ[playerid])return SendClientMessage(playerid,COLOR_WARNING, "Warning: you are not allowed to use this command to spawn positions!");
}
return SetPlayerHealth(playerid,0.0);
}
Could anybody tell me what is wrong?
Thanks
Re: Why do I get those warnings? -
Sascha - 21.04.2011
what about your "spawnInfo" definition?
Re: Why do I get those warnings? -
nuriel8833 - 21.04.2011
Quote:
Originally Posted by Sascha
what about your "spawnInfo" definition?
|
PHP Code:
new
spawnInfo[][spawnEnum] =
{
{ X, Y, Z, A, "N" },
{ X, Y, Z, A, "N" },
{ X, Y, Z, A, "N" },
{ X, Y, Z, A, "N" },
{ X, Y, Z, A, "N" },
{ X, Y, Z, A, "N" },
{ X, Y, Z, A, "N" },
{ X, Y, Z, A, "N" },
{ X, Y, Z, A, "N" }
}
;
Re: Why do I get those warnings? -
Vince - 21.04.2011
Show 'spawnEnum'. We need to see the tags of the variables. Likely you forgot to add the
Float: tag to your variables.
Re: Why do I get those warnings? -
nuriel8833 - 21.04.2011
Quote:
Originally Posted by Vince
Show 'spawnEnum'. We need to see the tags of the variables. Likely you forgot to add the Float: tag to your variables.
|
Nope I haven't forgotten:
PHP Code:
enum spawnEnum
{
Float: x,
Float: y,
Float: z,
Float: a,
location[24]
};
Re: Why do I get those warnings? -
Sascha - 21.04.2011
you did...
you need to write: Float: spawnInfo if any of those variables stored in it is a float...
Re: Why do I get those warnings? -
[ADC]Aldi96 - 21.04.2011
check your "[]" in script Spawninfo and you fix the warnings!!!
Re: Why do I get those warnings? -
nuriel8833 - 21.04.2011
Quote:
Originally Posted by Sascha
you did...
you need to write: Float: spawnInfo if any of those variables stored in it is a float...
|
Hmm.. what?
Sorry I could not understand you
Quote:
Originally Posted by [ADC]Aldi96
check your "[]" in script Spawninfo and you fix the warnings!!!
|
Noticed that.
But shall I change the spawninfo to [playerid] or shall I empty the brackets in the line I have errors?
Re: Why do I get those warnings? -
Sascha - 21.04.2011
Quote:
Originally Posted by Montserrat
Nope I haven't forgotten:
PHP Code:
enum spawnEnum
{
Float: x,
Float: y,
Float: z,
Float: a,
location[24]
};
|
you have:
new spawnInfo[][spawnEnums]
if one of the variables that is stored in this spawnInfo variable is a float, the major variable (spawnInfo) must be a variable, too.
In your case this is a string or integer, however it should be a float, as the X Y Z and A coords are floats...
just change it to "new Float

pawnInfo" and you'll be fine..
(except that you'll need to get another variable for the "location")
Re: Why do I get those warnings? -
nuriel8833 - 21.04.2011
Quote:
Originally Posted by Sascha
you have:
new spawnInfo[][spawnEnums]
if one of the variables that is stored in this spawnInfo variable is a float, the major variable (spawnInfo) must be a variable, too.
In your case this is a string or integer, however it should be a float, as the X Y Z and A coords are floats...
just change it to "new Float  pawnInfo" and you'll be fine..
(except that you'll need to get another variable for the "location")
|
Okay thanks

It works