[SAMP Scripting] 6 Tag Mismatch errors
#1

Hello.
I am creating some fun commands for the admins on my server. I created a /infammon command , but when i try to compile , it's says that there is 6 errors of "tag mismatch"
Here is where the error is :

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/deathmatch", cmdtext, true, 10) == 0)
	{
		SetPlayerPos(playerid, 1307.5884,-1158.6796,23.8281);
		SendClientMessage(playerid, COLOR_GREEN, "You have been teleported to the DeathMatch Area!");
		if (GetPlayerSkin(0))
		{
		GivePlayerWeapon(playerid, 22, 50);
		GivePlayerWeapon(playerid, 18, 5);
		}
		if (GetPlayerSkin(1))
		{
		GivePlayerWeapon(playerid, 25, 30);
		GivePlayerWeapon(playerid, 24, 40);
		}
		if (GetPlayerSkin(2))
		{
		GivePlayerWeapon(playerid, 23, 40);
		GivePlayerWeapon(playerid, 26, 35);
		}
		return 1;
	}
	if (strcmp("/safearea", cmdtext, true, 10) == 0)
	{
		SetPlayerPos(playerid, 701.5940,-519.2322,16.3302);
		ResetPlayerWeapons(playerid);
		SendClientMessage(playerid, COLOR_GREEN, "You have been teleported to the Safe Area!");
		return 1;
	}
	if (strcmp("/buyarmor", cmdtext, true, 10) == 0)
	{
		if (GetPlayerMoney(playerid) <1000)
		{
		SendClientMessage(playerid, COLOR_GREY, "You need at least 1000 bucks to buy an armor!");
		}

		if (GetPlayerMoney(playerid) >1000)
		{
		GivePlayerMoney(playerid, -1000);
		SetPlayerArmour(playerid, 100);
		SendClientMessage(playerid, COLOR_YELLOW, "Thanks you for buying an 1000 bucks worth Armor!");
		}
		return 1;
	}
	if (strcmp("/kill", cmdtext, true, 10) ==0)
	{
	    SetPlayerHealth(playerid, 0);
	    SendClientMessage(playerid, COLOR_YELLOW, "You commited a suicide.");
	    return 1;
    }
   	if (strcmp("/godon", cmdtext, true, 10) ==0)
	{
		if (!IsPlayerAdmin(playerid))
		{
	    SendClientMessage(playerid, COLOR_GREY, "You don't have access to this command.");
	 	}
	    if (IsPlayerAdmin(playerid))
	    {
	    SetPlayerHealth(playerid, INFINITE);
	    SendClientMessage(playerid, COLOR_YELLOW, "You are now GodMode.");
	    }
	    return 1;
    }
   	if (strcmp("/godoff", cmdtext, true, 10) ==0)
	{
		if (!IsPlayerAdmin(playerid))
		{
	    SendClientMessage(playerid, COLOR_GREY, "You don't have access to this command.");
	 	}
	    if (IsPlayerAdmin(playerid))
	    {
	        new Float:health;
	        GetPlayerHealth(playerid, health);
	    	if (health < 100.00000001)
	    	{
	    		SendClientMessage(playerid, COLOR_GREY, "Your GodMode is already disabled.");
			}
			if (health == INFINITE)
			{
			SetPlayerHealth(playerid, 99.9);
			SendClientMessage(playerid, COLOR_YELLOW, "You are no longer GodMode.");
			}
	    }
	    return 1;
	}
	if (strcmp("/infammon", cmdtext, true, 10) ==0)
	{
	    if(!IsPlayerAdmin(playerid))
	    {
	    SendClientMessage(playerid, COLOR_GREY, "You don't have access to this command.");
	    }
	    if(IsPlayerAdmin(playerid))
	    {
	    	if (GetPlayerAmmo(playerid) == INFINITE)
	    	{
	    		SendClientMessage(playerid, COLOR_GREY, "You already have Infinite Ammo activated.");
	    	}
	    	else
	    	{
				if (GetPlayerSkin(0))
				{
				SetPlayerAmmo(playerid, 22, INFINITE);
				SetPlayerAmmo(playerid, 18, INFINITE);
	    	               SendClientMessage(playerid, COLOR_YELLOW, "You have now Infinite Ammo.");
				}
				if (GetPlayerSkin(1))
				{
				SetPlayerAmmo(playerid, 25, INFINITE);
				SetPlayerAmmo(playerid, 24, INFINITE);
	    	               SendClientMessage(playerid, COLOR_YELLOW, "You have now Infinite Ammo.");
				}
				if (GetPlayerSkin(2))
				{
				SetPlayerAmmo(playerid, 23, INFINITE);
				SetPlayerAmmo(playerid, 26, INFINITE);
    			        SendClientMessage(playerid, COLOR_YELLOW, "You have now Infinite Ammo.");
				}
			}
		}
		return 1;
	}
	return 0;
}
And here is the error i get :

C:\DOCUME~1\HP_ADM~1\Bureau\SAMPSE~1\GAMEMO~1\test .pwn(223) : warning 213: tag mismatch
C:\DOCUME~1\HP_ADM~1\Bureau\SAMPSE~1\GAMEMO~1\test .pwn(224) : warning 213: tag mismatch
C:\DOCUME~1\HP_ADM~1\Bureau\SAMPSE~1\GAMEMO~1\test .pwn(229) : warning 213: tag mismatch
C:\DOCUME~1\HP_ADM~1\Bureau\SAMPSE~1\GAMEMO~1\test .pwn(230) : warning 213: tag mismatch
C:\DOCUME~1\HP_ADM~1\Bureau\SAMPSE~1\GAMEMO~1\test .pwn(235) : warning 213: tag mismatch
C:\DOCUME~1\HP_ADM~1\Bureau\SAMPSE~1\GAMEMO~1\test .pwn(236) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


6 Warnings.
Well , it's not errors , it's just warnings , but i really want to know why there are here.
Reply
#2

What ? 520 views ? O.o And no answer ?
Reply
#3

if (GetPlayerSkin(1))

Look at the syntax:

https://sampwiki.blast.hk/wiki/GetPlayerSkin

530 views is probably from you constantly refreshing this page, at a guess.
Reply
#4

So what should i change ?
Reply
#5

Did you even look at the page?
Reply
#6

I did but how this is supossed to help me ?
Reply
#7

The GetPlayerSkin code is wrong indeed. However, it is still syntactically correct, and not the actual source of the problem. The issue is most likely in the INFINITE definition which probably has the Float: tag, while the ammo parameter in the function is supposed to be an integer. Hence, tag mismatch.
Reply
#8

pawn Код:
if (strcmp("/kill", cmdtext, true, 10) ==0)
/kill doesn't have 10 characters at all, why ur using 10 then. And some commands you have 10+ characters.
Reply
#9

Quote:
Originally Posted by Vince
Посмотреть сообщение
The GetPlayerSkin code is wrong indeed. However, it is still syntactically correct.
Not if you know what the intended usage was. They are the skin IDs, not the playerid. Just because it's an int doesn't make it correct.
Reply
#10

Quote:
Originally Posted by MP2
Посмотреть сообщение
Not if you know what the intended usage was. They are the skin IDs, not the playerid. Just because it's an int doesn't make it correct.
I was talking about the Pawn language syntax - not function syntax - and why it would not give an error if the functions is (wrongly) used this way.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)