Tag mismatch...
#1

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

Which line is giving warning? .. Can you show please.
Reply
#3

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

pawn Код:
enum pInfo
{
    PosX,
    PosY,
    PosZ,
    PosAngle
}
When i add float: PosX then it shows 8 warnings.
Reply
#5

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

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;
}
Reply
#7

When I add that it's compiled successfully but when i register at my server it doesn't save my account at all.
Reply
#8

@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.
Reply
#9

Yes man, im sure.
Reply
#10

Sorry for bumping but i'm in hurry, please anyone?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)