Tag mismatch issue PLEASE READ.
#1

when i use this code i get 3 tag mismatches but it works when I test it ingame, i don't like having warning so i want to fix them.

pawn Код:
new posx[20][MAX_PLAYERS]; new posy[20][MAX_PLAYERS]; new posz[20][MAX_PLAYERS];
    strpack(posx[playerid], fileinfo[playerid][pPos_x],20);
    strpack(posy[playerid], fileinfo[playerid][pPos_y],20);
    strpack(posz[playerid], fileinfo[playerid][pPos_z],20);
    if(!strcmp(posx[playerid],"0.000000",true) && !strcmp(posy[playerid],"0.000000",true) && strcmp(posz[playerid],"0.000000",true))
    {
    new rand = random(sizeof(gRandomPlayerSpawns));
  fileinfo[playerid][pPos_x] = gRandomPlayerSpawns[rand][0];
  fileinfo[playerid][pPos_y] = gRandomPlayerSpawns[rand][1];
  fileinfo[playerid][pPos_z] = gRandomPlayerSpawns[rand][2];
  fileinfo[playerid][pInt] = 0;
  fileinfo[playerid][pWorld] = 0;
  }
these are the three lines i get the warnings on.

pawn Код:
strpack(posx[playerid], fileinfo[playerid][pPos_x],20);
    strpack(posy[playerid], fileinfo[playerid][pPos_y],20);
    strpack(posz[playerid], fileinfo[playerid][pPos_z],20);
these are the warnings
Код:
C:\Documents and Settings\Marcus's\My Documents\Gta Server\gamemodes\cem.pwn(13053) : warning 213: tag mismatch
C:\Documents and Settings\Marcus's\My Documents\Gta Server\gamemodes\cem.pwn(13054) : warning 213: tag mismatch
C:\Documents and Settings\Marcus's\My Documents\Gta Server\gamemodes\cem.pwn(13055) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Warnings.
thanks for your help.
Reply
#2

Parameters of strpack:
pawn Код:
(dest[],const source[],maxlength=sizeof dest)
And also you're having a mistake here:
pawn Код:
strcmp(posz[playerid],"0.000000",true))
It should be:
pawn Код:
!strcmp(posz[playerid],"0.000000",true))
Reply
#3

Quote:
Originally Posted by MenaceX^
Parameters of strpack:
pawn Код:
(dest[],const source[],maxlength=sizeof dest)
And also you're having a mistake here:
pawn Код:
strcmp(posz[playerid],"0.000000",true))
It should be:
pawn Код:
!strcmp(posz[playerid],"0.000000",true))
thanks but i am doing it like that,

pawn Код:
strpack(posz[playerid], fileinfo[playerid][pPos_z],20);
(dest[],const source[],maxlength=sizeof dest)

dest[] = posz[playerid]

const source[] = fileinfo[playerid][pPos_x]

maxlength=sizeof dest = 20.

so i'm confused why its not working.
Reply
#4

bump.
Reply
#5

I wonder why do you even strpack it? You can just compare floats like
pawn Код:
if(posx[playerid] == 0.0) { }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)