SA-MP Forums Archive
Why tag mistmatch? - 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)
+--- Thread: Why tag mistmatch? (/showthread.php?tid=634685)



Why tag mistmatch? - akib - 24.05.2017

Code:
Код:
        new float:arm,float:heal;
	GetPlayerHealth(playerid,heal);
	GetPlayerArmour(playerid,arm);
error :
Код:
D:\GTA San Andreas\Server\gamemodes\mysql1.pwn(139) : warning 213: tag mismatch
D:\GTA San Andreas\Server\gamemodes\mysql1.pwn(140) : warning 213: tag mismatch



Re: Why tag mistmatch? - AbyssMorgan - 24.05.2017

Float: not float:


Re: Why tag mistmatch? - akib - 24.05.2017

Код:
new Float:arm,Float:heal;
	GetPlayerHealth(playerid,heal);
	GetPlayerArmour(playerid,arm);
    Player[playerid][Health] = heal;
    Player[playerid][Health] = arm;
still problem


Re: Why tag mistmatch? - rockhopper - 24.05.2017

Why are you even using float? Float is for co ordinates.

Quote:

new armour, health;

Simple as that.

"Float" is used for co-ordinates(X,Y,Z) Mostly for getting and saving a player's position.


Re: Why tag mistmatch? - Dayrion - 24.05.2017

Quote:
Originally Posted by rockhopper
Посмотреть сообщение
Why are you even using float? Float is for co ordinates.



Simple as that.

"Float" is used for co-ordinates(X,Y,Z) Mostly for getting and saving a player's position.
No, not really.
Float is for real numbers and integer (without Float tag) is only relative numbers.

OT: Can you show the complete code and not 2 lines? Also, show the enum which you store the health and armour.


Re: Why tag mistmatch? - Affan - 24.05.2017

Which line exactly and which error, because the resolution by AbyssMorgan should fix it.


Re: Why tag mistmatch? - ISmokezU - 24.05.2017

This is because you're inserting two different values into health:

Код:
new Float:arm, Float:heal;
	GetPlayerHealth(playerid,heal);
	GetPlayerArmour(playerid,arm);
    Player[playerid][Health] = heal;
    Player[playerid][Health] = arm;
You're putting arm into Health.

Try:

Код:
new Float:arm, Float:heal;
	GetPlayerHealth(playerid,heal);
	GetPlayerArmour(playerid,arm);
    Player[playerid][Health] = heal;
    Player[playerid][Armour] = arm;
Or Even (Recommended):

PHP код:
GetPlayerHealth(playeridPlayer[playerid][Health]), GetPlayerArmour(playeridPlayer[playerid][Armour]); 



Re: Why tag mistmatch? - Sew_Sumi - 24.05.2017

What Dayrion said is important... Show the enum.

The mistake in assigning the value incorrectly, is nothing compared to the error.


Re: Why tag mistmatch? - iLearner - 24.05.2017

Quote:
Originally Posted by ISmokezU
Посмотреть сообщение
This is because you're inserting two different values into health:

Код:
new Float:arm, Float:heal;
	GetPlayerHealth(playerid,heal);
	GetPlayerArmour(playerid,arm);
    Player[playerid][Health] = heal;
    Player[playerid][Health] = arm;
You're putting arm into Health.

Try:

Код:
new Float:arm, Float:heal;
	GetPlayerHealth(playerid,heal);
	GetPlayerArmour(playerid,arm);
    Player[playerid][Health] = heal;
    Player[playerid][Armour] = arm;
Or Even (Recommended):

PHP код:
GetPlayerHealth(playeridPlayer[playerid][Health]), GetPlayerArmour(playeridPlayer[playerid][Armour]); 
Assigning same value to 2 different variable doesn't causes any problems.

What I am assuming is; op declared health and armour in enum as float: instead of Float.