tag mismatch
#1

new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X,Y,Z);
PlayerInfo[playerid][xPos] = X;
PlayerInfo[playerid][yPos] = Y;
PlayerInfo[playerid][zPos] = Z;

This is my code. It is saying that these lines are tag mismatch:

PlayerInfo[playerid][xPos] = X;
PlayerInfo[playerid][yPos] = Y;
PlayerInfo[playerid][zPos] = Z;

But why?

Thanks for your help peeps =]
Reply
#2

XPos, YPos and ZPos have to be declared as floats (:Float).
Reply
#3

Do you have them defined as enumerations or variables?
The one you stated there looks like enumueration.
Plus, show us your yPos,yPox and zPos (by showing i mean show us how are they defined).
Reply
#4

I think it already is:
Код:
enum pInfo
{
	pGold,
	pSilver,
	pBronze,
	pClass,
	Float:xPos,
	Float:yPos,
	Float:zPos
};

new PlayerInfo[MAX_PLAYERS][pInfo];
Reply
#5

I just made those changed... added the FloatPos, Float:yPos, Float:zPos and the GetPlayerPos line is now fixed. But the errors are the same on the saving:

Код:
dini_IntSet(file,"lastX",PlayerInfo[playerid][xPos]);
dini_IntSet(file,"lastY",PlayerInfo[playerid][yPos]);
dini_IntSet(file,"lastZ",PlayerInfo[playerid][zPos]);
How can i make them floats?
Reply
#6

Quote:
Originally Posted by lewismichaelbbc
Посмотреть сообщение
I think it already is:
Код:
enum pInfo
{
	pGold,
	pSilver,
	pBronze,
	pClass,
	Float:xPos,
	Float:yPos,
	Float:zPos
};

new PlayerInfo[MAX_PLAYERS][pInfo];
I tried the same thing in my game mode.
It did not give any errors, please re-check the error lines.
Reply
#7

The Float: Thingy's fixed my last errors, but now i have some new errors, which I think is something to do with the 'Float:'

Errors:
Код:
C:\Users\Lewis\Desktop\samp03e_svr_R2_win32\gamemodes\mmorpg.pwn(1034) : warning 213: tag mismatch
C:\Users\Lewis\Desktop\samp03e_svr_R2_win32\gamemodes\mmorpg.pwn(1035) : warning 213: tag mismatch
C:\Users\Lewis\Desktop\samp03e_svr_R2_win32\gamemodes\mmorpg.pwn(1036) : warning 213: tag mismatch
Lines: 1034, 1035,1036
Код:
dini_IntSet(file,"lastX",PlayerInfo[playerid][xPos]);
dini_IntSet(file,"lastY",PlayerInfo[playerid][yPos]);
dini_IntSet(file,"lastZ",PlayerInfo[playerid][zPos]);
Reply
#8

Found the problem. I changed dini_IntSet to dini_FloatSet and now i am error free! Thanks
Reply
#9

Try changing dini_IntSet to dini_ i dont remember it i guess it was FloatSet? its been a while since i used dini.
dini_FloatSet.
Since you are declaring your enum as float, it should be dini_FloatSet.
EDIT: late.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)