Tag mismatch
#1

Im good at fixing my errors but this error is unfamiliar, i just need to know how to fix it and then i know how to do it ;P
Код:
	if (strcmp(cmd, "/register", true)==0)
	{
		new string[265];
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_GREY, "USAGE: /register [password]");
			return 1;
		}
		if (gPlayerAccount[playerid] == 1)
		{

  	format(string, sizeof(string), "~r~THAT NAME IS ALREADY REGISTERED!");
  	GameTextForPlayer(playerid, string, 3000, 4);
			return 1;
		}

		strmid(PlayerInfo[playerid][pPassword], tmp, 0, strlen(cmdtext), 255); //LINE 4739
		Encrypt(PlayerInfo[playerid][pPassword]);
		GetPlayerName(playerid, playername1, sizeof(playername1));
		format(string, sizeof(string), "%s.cer", playername1);
		new File: file = fopen(string, io_read);
		if (file)
		{
  	format(string, sizeof(string), "~r~THAT NAME IS ALREADY REGISTERED!");
  	GameTextForPlayer(playerid, string, 3000, 4);
			fclose(file);
			return 1;
		}
		new File:hFile;
		hFile = fopen(string, io_append);
		new var[32];//
    format(var, 32, "%s\n", PlayerInfo[playerid][pPassword]);fwrite(hFile, var);
    format(var, 32, "Kills=%d\n",PlayerInfo[playerid][pKills]);fwrite(hFile, var);
    format(var, 32, "Deaths=%d\n",PlayerInfo[playerid][pDeaths]);fwrite(hFile, var);
    PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
    format(var, 32, "Money=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);
		fclose(hFile);
		SendClientMessage(playerid, COLOR_WHITE, "Succesfully Registered!");
  	format(string, sizeof(string), "~w~Next time you connect, type /login <password> to log in!");
  	GameTextForPlayer(playerid, string, 3000, 4);
		OnPlayerLogin(playerid,PlayerInfo[playerid][pPassword]);
		return 1;
	}
and
Код:
public OnPlayerUpdate(playerid)
{
	if(IsPlayerConnected(playerid))
	{
		if(gPlayerLogged[playerid])
		{
			new string3[32];
			new pname3[MAX_PLAYER_NAME];
			GetPlayerName(playerid, pname3, sizeof(pname3));
			format(string3, sizeof(string3), "%s.cer", pname3);
			new File: pFile = fopen(string3, io_write);
			if (pFile)
			{
				new var[32];
				format(var, 32, "%s\n", PlayerInfo[playerid][pPassword]);fwrite(pFile, var); //line 9300
				fclose(pFile);
				new File: hFile = fopen(string3, io_append);
				PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
				format(var, 32, "Kills=%d\n",PlayerInfo[playerid][pKills]);fwrite(hFile, var);
				format(var, 32, "Deaths=%d\n",PlayerInfo[playerid][pDeaths]);fwrite(hFile, var);
				format(var, 32, "Money=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);
				fclose(hFile);
			}
		}
	}
	return 1;
}

stock ini_GetKey( line[] )
{
	new keyRes[128];
	keyRes[0] = 0;
  if ( strfind( line , "=" , true ) == -1 ) return keyRes;
  strmid( keyRes , line , 0 , strfind( line , "=" , true ) , sizeof( keyRes) );
  return keyRes;
}

stock ini_GetValue( line[] )
{
	new valRes[128];
	valRes[0]=0;
	if ( strfind( line , "=" , true ) == -1 ) return valRes;
	strmid( valRes , line , strfind( line , "=" , true )+1 , strlen( line ) , sizeof( valRes ) );
	return valRes;
}



public ShowStats(playerid,targetid)
{
  if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
	{
		new cash = GetPlayerMoney(targetid);
		new deaths = PlayerInfo[targetid][pDeaths];
		new kills = PlayerInfo[targetid][pKills];
		new name[MAX_PLAYER_NAME];
		GetPlayerName(targetid, name, sizeof(name));
		new Float:px,Float:py,Float:pz;
		GetPlayerPos(targetid, px, py, pz);
		new coordsstring[256];
		SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
		format(coordsstring, sizeof(coordsstring),"*** %s ***",name);
		SendClientMessage(playerid, COLOR_WHITE,coordsstring);
		format(coordsstring, sizeof(coordsstring), "Kills:[%d] Deaths:[%d] Cash:[$%d]",kills,deaths,cash);
		SendClientMessage(playerid, COLOR_GRAD5,coordsstring);
		SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
	}
}
Quote:

C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(4739) : warning 213: tag mismatch
C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(4740) : warning 213: tag mismatch
C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(4754) : warning 213: tag mismatch
C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(4755) : warning 213: tag mismatch
C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(4755) : error 032: array index out of bounds (variable "PlayerInfo")
C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(4756) : warning 213: tag mismatch
C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(4756) : error 032: array index out of bounds (variable "PlayerInfo")
C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(4757) : warning 213: tag mismatch
C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(4757) : error 032: array index out of bounds (variable "PlayerInfo")
C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(475 : warning 213: tag mismatch
C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(475 : error 032: array index out of bounds (variable "PlayerInfo")
C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(4763) : warning 213: tag mismatch
C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(9300) : warning 213: tag mismatch
C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(9303) : warning 213: tag mismatch
C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(9303) : error 032: array index out of bounds (variable "PlayerInfo")
C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(9304) : warning 213: tag mismatch
C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(9304) : error 032: array index out of bounds (variable "PlayerInfo")
C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(9305) : warning 213: tag mismatch
C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(9305) : error 032: array index out of bounds (variable "PlayerInfo")
C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(9306) : warning 213: tag mismatch
C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(9306) : error 032: array index out of bounds (variable "PlayerInfo")
C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(9339) : warning 213: tag mismatch
C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(9339) : error 032: array index out of bounds (variable "PlayerInfo")
C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(9340) : warning 213: tag mismatch
C:\DOCUME~1\ANNIKA~1.DIT\MINADO~1\Pawno\pawno\IDM. pwn(9340) : error 032: array index out of bounds (variable "PlayerInfo")

2kinds of error, i know its easy to fix but i dont know how to fix it, so please help me, i dont want you to spend time fixing the whole code if you want to , just tell me how to fix it ^^ or you can fix it if you want and tell me how u did it^^
Reply
#2

Tag Mismatch is where two pieces of data are in the wrong order I think, for example.

if I had SendClientMessage(playerid, "Hi", RED);

Then I would get that error because RED should be before the message, if I were you, i'd look over the syntax for your code and check it fits

I may be wrong though, just thought i'd attempt to help.
Reply
#3

Isnt this correct?
Код:
   PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
It gives tag mismatch....
Reply
#4

you cant use
new cash = GetPlayerMoney(playerid);
?
Reply
#5

TIP: Dont put that save shit under onplayerupdate, if you got 30 players, it'll open 30 files and close them every 0.5 secodns or smth.
Reply
#6

Quote:
Originally Posted by Pandabeer1337
TIP: Dont put that save shit under onplayerupdate, if you got 30 players, it'll open 30 files and close them every 0.5 secodns or smth.
Where should i put it then?
Reply
#7

Quote:
Originally Posted by SuperS0nic
Quote:
Originally Posted by Pandabeer1337
TIP: Dont put that save shit under onplayerupdate, if you got 30 players, it'll open 30 files and close them every 0.5 secodns or smth.
Where should i put it then?
Make a new function like OnPlayerStatsUpdate,
On this way you're realy flooding your server and wasting very very mutch CPU and memory, it could even crash your server with many players.
Reply
#8

Fuck fuck fuck, everything is gone because of a stupid mistake, i removed one user and now all the files are gone, cause my main account on the PC didnt work, cause it gaved me errors when i signed in so i removed it and i forgot about my pawno files.
How do i recover removed files?
NVM found the file in C:, its appearently storing all the compiler files there
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)