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)
+--- Thread: Tag mismatch... (
/showthread.php?tid=380138)
Tag mismatch... -
anito - 24.09.2012
pawn Код:
COMMAND:savepos(playerid, params[])
{
new Float:XPos, Float:YPos, Float:ZPos, Float:AnglePos;
GetPlayerPos(playerid, XPos, YPos, ZPos);
GetPlayerFacingAngle(playerid, AnglePos);
PlayerInfo[playerid][PosX] = XPos;
PlayerInfo[playerid][PosY] = YPos;
PlayerInfo[playerid][PosZ] = ZPos;
PlayerInfo[playerid][PosAngle] = AnglePos;
SendClientMessage(playerid, GREEN, "Position saved.");
return 1;
}
It's driving me crazy...
EDIT:
pawn Код:
PlayerInfo[playerid][PosX] = XPos; // warning 213: tag mismatch
PlayerInfo[playerid][PosY] = YPos; // warning 213: tag mismatch
PlayerInfo[playerid][PosZ] = ZPos; // warning 213: tag mismatch
PlayerInfo[playerid][PosAngle] = AnglePos; // warning 213: tag mismatch
Re: Tag mismatch... - Jarnu - 24.09.2012
Which line is giving warning? .. Can you show please.
Re: Tag mismatch... -
Vince - 24.09.2012
Why all these unnecessary variables?
pawn Код:
COMMAND:savepos(playerid, params[])
{
GetPlayerPos(playerid, PlayerInfo[playerid][PosX], PlayerInfo[playerid][PosY], PlayerInfo[playerid][PosZ]);
GetPlayerFacingAngle(playerid, PlayerInfo[playerid][PosAngle]);
SendClientMessage(playerid, GREEN, "Position saved.");
return 1;
}
And make sure that PosX, PosY, PosZ and PosAngle are declared
floats in your enumerator.
Re: Tag mismatch... -
anito - 24.09.2012
pawn Код:
enum pInfo
{
PosX,
PosY,
PosZ,
PosAngle
}
When i add
float: PosX then it shows 8 warnings.
Re: Tag mismatch... -
[GOD]Dragonster82 - 24.09.2012
@Vince I'm pretty sure that the GetPlayerPos and GetPlayerFacingAngle is for the server to get the information out first, then save it into the data.
Re: Tag mismatch... -
Danyal - 24.09.2012
Just change your enum you are saving float...
pawn Код:
enum pInfo
{
Float:PosX,
Float:PosY,
Float:PosZ,
Float:PosAngle
}
new PlayerInfo[MAX_PLAYERS+1][pInfo];
COMMAND:savepos(playerid, params[])
{
new Float:x, Float:y, Float:z, Float:angle;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid, angle);
PlayerInfo[playerid][PosX] = x;
PlayerInfo[playerid][PosY] = y;
PlayerInfo[playerid][PosZ] = z;
PlayerInfo[playerid][PosAngle] = angle;
SendClientMessage(playerid, -1, "Position saved.");
return 1;
}
Re: Tag mismatch... -
anito - 24.09.2012
When I add that it's compiled successfully but when i register at my server it doesn't save my account at all.
Re: Tag mismatch... -
[GOD]Dragonster82 - 24.09.2012
@anito did you delete everything in your enum pInfo and replaced it with the code that Danyal gave you? If so, then do a restore and add the enum pinfo variables INTO , not replace the whole thing with it.
Re: Tag mismatch... -
anito - 24.09.2012
Yes man, im sure.
Re: Tag mismatch... -
anito - 24.09.2012
Sorry for bumping but i'm in hurry, please anyone?