SA-MP Forums Archive
[Help] Warning 213: Tag Mismatch - 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: [Help] Warning 213: Tag Mismatch (/showthread.php?tid=120936)



[Help] Warning 213: Tag Mismatch - cembry90 - 14.01.2010

Ok, this is my first major attempt at filterscripting.
I have successfully made an island and added dcmd commands to open gates, fixing errors using the forum's search feature (it works wonders!).
However, I'm now writing a dcmd 'jail' command (/j [id] [cell]) but get these warnings (which also prevent the /j command from working correctly at all) and have found no useful help searching the forum...

Код:
C:\Users\Chris\Desktop\Gaming\sampSrv\filterscripts\fs1.pwn(615) : warning 213: tag mismatch
C:\Users\Chris\Desktop\Gaming\sampSrv\filterscripts\fs1.pwn(619) : warning 213: tag mismatch
C:\Users\Chris\Desktop\Gaming\sampSrv\filterscripts\fs1.pwn(623) : warning 213: tag mismatch
C:\Users\Chris\Desktop\Gaming\sampSrv\filterscripts\fs1.pwn(627) : warning 213: tag mismatch
C:\Users\Chris\Desktop\Gaming\sampSrv\filterscripts\fs1.pwn(631) : warning 213: tag mismatch
C:\Users\Chris\Desktop\Gaming\sampSrv\filterscripts\fs1.pwn(635) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Warnings.
Here is my code (the sections relevant to the error).
Код:
new xxx,yyy,zzz;		//these are at the very top of my
new playname;		//script under #define FILTERSCRIPT
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	dcmd(j,1,cmdtext);
}
Код:
dcmd_j(playerid, params[])
{
	#pragma unused params
	if(IsPlayerAdmin(playerid))
	{
		if(params[1] == 1 || params[1] == 2 || params[1] == 3 || params[1] == 4)
		{
			xxx = 853.75;						//615
		}
		else if(params[1] == 5 || params[1] == 6 || params[1] == 7 || params[1] == 8)
		{
			xxx = 819.25;						//619
		}
		if(params[1] == 1 || params[1] == 5)
		{
			yyy = -2245.5;						//623
		}
		else if(params[1] == 2 || params[1] == 6)
		{
			yyy = -2268.5;						//627
		}
		else if(params[1] == 3 || params[1] == 7)
		{
			yyy = -2291.5;						//631
		}
		else if(params[1] == 4 || params[1] == 8)
		{
			yyy = -2314.5;						//635
		}
		zzz = 15;
		SetPlayerPos(params[0],xxx,yyy,zzz);
		new string[100];
		GetPlayerName(params[0],playname,64);
		format(string, sizeof(string),"You have jailed %s.", playname);
		SendClientMessage(playerid,0x00bb00FF,string);
		GetPlayerName(playerid,playname,64);
		format(string, sizeof(string),"%s has jailed you!", playname);
		SendClientMessage(params[1],0xbb0000FF,string);
	}
	return 1;
}
I constructed the if() statement the way I did so that I have less to worry as far as determining what cell they should go into.
(If the user types 1||2||3||4 then the X is one side; 5||6||7||8 is the other side)
(If the user types 1||5 then the Y is row one; 2||6 is row two; 3||7 is row three; 4||8 is row four)
X is static, the same with every cell.

Here is a crappy attempt at screenshotting my objects to give you an idea of where it should move them.
My guess is it is something related to the way xxx, yyy, and zzz are defined.
All help is greatly appreciated!

~Chris


Re: [Help] Warning 213: Tag Mismatch - Correlli - 14.01.2010

You forgot to set the Float: tag.


Re: [Help] Warning 213: Tag Mismatch - cembry90 - 14.01.2010

Quote:
Originally Posted by Don Correlli
You forgot to set the Float: tag.
Exactly where, might I ask?

I assume:
Код:
new Float:xxx,Float:yyy,Float:zzz;
?

This gives more errors (10 now).

I'm sorry for begging but I'm still learning.

Thanks for an awesomely speedy reply! (ф.ф)

~Chris


Re: [Help] Warning 213: Tag Mismatch - smeti - 14.01.2010

pawn Код:
new playname[MAX_PLAYER_NAME];
GetPlayerName(playerid, playname, sizeof(playname));



Re: [Help] Warning 213: Tag Mismatch - cembry90 - 14.01.2010

Quote:
Originally Posted by Phento
pawn Код:
new playname[MAX_PLAYER_NAME];
GetPlayerName(playerid, playname, sizeof(playname));
I've been playing with the code and looking through the wiki files and all I can get to function correctly is the correct player specified is teleported (thanks to Phento) to an incorrect X and Y yet correct Z coordinate.

Again, help is much appreciated!

~Chris


Re: [Help] Warning 213: Tag Mismatch - cembry90 - 14.01.2010

FIXED
sscanf() ftw!
Note:

Did a full night (yes, no sleep , nearly 8 hours past time to go to sleep and time to wake up) of searching anything and everything I could find...
(Don't know how I missed this on the wiki.. Oh well.)
Код:
new Float:xxx,Float:yyy,Float:zzz,uid,uce;
Код:
dcmd_j(playerid, params[])
{
	#pragma unused params
	if(IsPlayerAdmin(playerid))
	{
		if(sscanf(params, "ui", uid, uce))
		{
			SendClientMessage(playerid, 0xff0000FF, "Usage: \"/j [id] [cell]\"");
		}
		else if(uid == INVALID_PLAYER_ID)
		{
			SendClientMessage(playerid, 0xFF0000AA, "Player not found");
		}
		else
		{
			if(uce == 1 || uce == 2 || uce == 3 || uce == 4)
			{
				xxx = 853.75;
			}
			else if(uce == 5 || uce == 6 ||uce == 7 || uce == 8)
			{
				xxx = 819.25;
			}
			if(uce == 1 || uce == 5)
			{
				yyy = -2245.50;
			}
			else if(uce == 2 || uce == 6)
			{
				yyy = -2268.50;
			}
			else if(uce == 3 || uce == 7)
			{
				yyy = -2291.50;
			}
			else if(uce == 4 || uce == 8)
			{
				yyy = -2314.50;
			}
			zzz = 15.00;
		}
	}
	return 1;
}