Why do I get those warnings?
#1

Hello everyone.
I was making a tiny command but whenever I compile my server I get 3 warnings:
PHP Code:
warning 213tag 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=0i<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
Reply
#2

what about your "spawnInfo" definition?
Reply
#3

Quote:
Originally Posted by Sascha
View Post
what about your "spawnInfo" definition?
PHP Code:

new
    
spawnInfo[][spawnEnum] =
    {
        { 
XYZA"N" },
        { 
XYZA"N" },
        { 
XYZA"N" },
        { 
XYZA"N" },
        { 
XYZA"N" },
        { 
XYZA"N" },
        { 
XYZA"N" },
        { 
XYZA"N" },
        { 
XYZA"N" }
    }

Reply
#4

Show 'spawnEnum'. We need to see the tags of the variables. Likely you forgot to add the Float: tag to your variables.
Reply
#5

Quote:
Originally Posted by Vince
View Post
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
{
    
Floatx,
    
Floaty,
    
Floatz,
    
Floata,
    
location[24]
}; 
Reply
#6

you did...
you need to write: Float: spawnInfo if any of those variables stored in it is a float...
Reply
#7

check your "[]" in script Spawninfo and you fix the warnings!!!
Reply
#8

Quote:
Originally Posted by Sascha
View Post
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
View Post
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?
Reply
#9

Quote:
Originally Posted by Montserrat
View Post
Nope I haven't forgotten:
PHP Code:
enum spawnEnum
{
    
Floatx,
    
Floaty,
    
Floatz,
    
Floata,
    
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 FloatpawnInfo" and you'll be fine..
(except that you'll need to get another variable for the "location")
Reply
#10

Quote:
Originally Posted by Sascha
View Post
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 FloatpawnInfo" and you'll be fine..
(except that you'll need to get another variable for the "location")
Okay thanks
It works
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)