SA-MP Forums Archive
Why do I get those warnings? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Why do I get those warnings? (/showthread.php?tid=249937)



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 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


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
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" }
    }




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
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]
}; 



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
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?


Re: Why do I get those warnings? - Sascha - 21.04.2011

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")


Re: Why do I get those warnings? - nuriel8833 - 21.04.2011

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