Why tag mistmatch?
#1

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
Reply
#2

Float: not float:
Reply
#3

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

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.
Reply
#5

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.
Reply
#6

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

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]); 
Reply
#8

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)