tag miss match
#1

Quote:

C:\Users\Tony\Desktop\Base-RP\gamemodes\baserp.pwn(117 : warning 213: tag mismatch
C:\Users\Tony\Desktop\Base-RP\gamemodes\baserp.pwn(1194) : warning 213: tag mismatch
C:\Users\Tony\Desktop\Base-RP\gamemodes\baserp.pwn(1210) : warning 213: tag mismatch
C:\Users\Tony\Desktop\Base-RP\gamemodes\baserp.pwn(1226) : warning 213: tag mismatch
C:\Users\Tony\Desktop\Base-RP\gamemodes\baserp.pwn(1541) : warning 213: tag mismatch
C:\Users\Tony\Desktop\Base-RP\gamemodes\baserp.pwn(1543) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


6 Warnings.

and here from top to bottom the sections with the error( i write line numbers infront of the specific line!):

Код:
stock FaktionSpawnX(playerid)
{
	new Escape[2][MAX_PLAYER_NAME];
	new Float:result;

	mysql_real_escape_string(PlayerInfo[playerid][pFaktion], Escape[0]);
	mysql_real_escape_string(mysql_fraktion_table, Escape[1]);


	format(query, sizeof(query), "SELECT SpawnX FROM `%s` WHERE `fraktion` = '%s'", Escape[1], Escape[0]);
	mysql_query(query);
	mysql_store_result();
	mysql_fetch_float(result);

1178 ->	return Float:result;
}
Код:
stock FaktionSpawnY(playerid)
{
	new Escape[2][MAX_PLAYER_NAME];
	new Float:result;

	mysql_real_escape_string(PlayerInfo[playerid][pFaktion], Escape[0]);
	mysql_real_escape_string(mysql_fraktion_table, Escape[1]);

	format(query, sizeof(query), "SELECT SpawnY FROM `%s` WHERE `fraktion` = '%s'", Escape[1], Escape[0]);
	mysql_query(query);
	mysql_store_result();
	mysql_fetch_float(result);

1194 ->	return Float:result;
}
Код:
stock FaktionSpawnZ(playerid)
{
	new Escape[2][MAX_PLAYER_NAME];
	new Float:result;

	mysql_real_escape_string(PlayerInfo[playerid][pFaktion], Escape[0]);
	mysql_real_escape_string(mysql_fraktion_table, Escape[1]);

	format(query, sizeof(query), "SELECT SpawnZ FROM `%s` WHERE `fraktion` = '%s'", Escape[1], Escape[0]);
	mysql_query(query);
	mysql_store_result();
	mysql_fetch_float(result);

1210 ->	return Float:result;
}
Код:
stock FaktionPosR(playerid)
{
	new Escape[2][MAX_PLAYER_NAME];
	new Float:result;

	mysql_real_escape_string(PlayerInfo[playerid][pFaktion], Escape[0]);
	mysql_real_escape_string(mysql_fraktion_table, Escape[1]);

	format(query, sizeof(query), "SELECT SpawnR FROM `%s` WHERE `fraktion` = '%s'", Escape[1], Escape[0]);
	mysql_query(query);
	mysql_store_result();
	mysql_fetch_float(result);

1226 ->	return Float:result;
}
Код:
#define MAX_ADMINRANG   (8)
#define MAX_RANG_LEN    (64) // Max length of rang name

enum ranginfo
{
	RangNummer,
	RangName[MAX_RANG_LEN]
}

new AdminRang[MAX_ADMINRANG][ranginfo] =
{
	{1, "Probe Supporter"}, {2, "Supporter"}, {3, "Moderator"}, {4, "Super-Moderator"}, {5, "Administrator"}, {6, "Super-Administrator"}, {7, "Serververwaltung"}, {8, "Serverleitung"}
};
Код:
stock GetAdminRangName(playerid)
{
	new rangname[64];
	new fehlername[64];
	
	fehlername = "Hacker";

	for(new i = 0; i < MAX_ADMINRANG; i++)
	{
	    new level = PlayerInfo[playerid][pAdmin];
1541 ->	    if(AdminRang[i][0] == level)
	    {
1543 ->	        format(rangname, sizeof(rangname), "%s", AdminRang[i][1]);
	        return rangname;
		}
	}

 	format(rangname, sizeof(rangname), "%s", fehlername);
	return rangname;
}
Thanks for reading this

MfG,
BigBrainAFK
Reply
#2

At the stock you want to return a float, you should have the Float tag after stock and before the name.

An example for the first one:
pawn Код:
stock Float:FaktionSpawnX(playerid)
{
    new Escape[2][MAX_PLAYER_NAME];
    new Float:result;
   
    mysql_real_escape_string(PlayerInfo[playerid][pFaktion], Escape[0]);
    mysql_real_escape_string(mysql_fraktion_table, Escape[1]);
   
   
    format(query, sizeof(query), "SELECT SpawnX FROM `%s` WHERE `fraktion` = '%s'", Escape[1], Escape[0]);
    mysql_query(query);
    mysql_store_result();
    mysql_fetch_float(result);
   
    return result;
}
Do the same for FaktionSpawnY, FaktionSpawnZ and FaktionPosR.

Note that if those function with the Float tag are after the part they're used, they will give error. So either move the function BEFORE or use "forward Float: function_name_here(parameters_here);".

Also change:
pawn Код:
if(AdminRang[i][0] == level)
to:
pawn Код:
if(AdminRang[i][RangNummer] == level)
and change:
pawn Код:
format(rangname, sizeof(rangname), "%s", AdminRang[i][1]);
to:
pawn Код:
format(rangname, sizeof(rangname), "%s", AdminRang[i][RangName]);
Reply
#3

Thanks for the quick help.



please close the thread problem solved.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)