Tag mismatch
#1

Код:
PlayerInfo[playerid][pDrugs] = PlayerInfo[playerid][pDrugs]+vehTrunkDrugs[result];
Says it output:
warning 213: Tag mismatch

I dont see any mistakes.. Can anyone help?
Reply
#2

http://forum.sa-mp.com/index.php?topic=167147.0
Reply
#3

Show us the vehTrunk... variable
Reply
#4

Quote:
Originally Posted by FUNExtreme
Show us the vehTrunk... variable
What?

Код:
new vehTrunk[MAX_VEHICLES][MAX_TRUNK_SLOTS];
Reply
#5

« Reply #3 on: May 11, 2010, 10:31:34 pm » && So 12h is over.

Код:
new Float:vehTrunkMats[MAX_VEHICLES];
new Float:vehTrunkDrugs[MAX_VEHICLES];
Can anyone help? Still can't fix...

Result:
PlayerInfo[playerid][pDrugs] += vehTrunkDrugs[result];

Explain:
Compile output without warning & error, but ... doenst work it.

I put 100 materials into trunk and taking materials trunk off, then i have 10 billions materials... Must be 100 materials not 10b..
Reply
#6

Why are they floats?
Reply
#7

Quote:
Originally Posted by juice.j
Why are they floats?
I dont know, i followed like: new Float:vehTrunkArmour[MAX_VEHICLES];

Then "Float:" isn't needed?
Reply
#8

Depends on the rest of your code.

Anyways the problem is most likely vehTrunkDrugs[result]. What is result?
Reply
#9

I think, result is:
I put 100 drugs, then result 100 or it's car ID?

/trunk command: http://pawn.pastebin.com/B6ThWLWt

I removed 2 thing's "Float:" and i get 2 warning's.

Output
Код:
C:\Documents and Settings\Kasutaja\My Documents\SAMP\gamemodes\sg.pwn(48150) : warning 213: tag mismatch
C:\Documents and Settings\Kasutaja\My Documents\SAMP\gamemodes\sg.pwn(48151) : warning 213: tag mismatch
Code
Код:
		  vehTrunkMats[idx] = floatstr(arrCoords[10]);
		  vehTrunkDrugs[idx] = floatstr(arrCoords[11]);
Full Code
Код:
public LoadTrunk()
{
	new arrCoords[13][64];
	new strFromFile2[256];
	new File: file = fopen("trunk.cfg", io_read);
	if (file)
	{
		new idx = 1;
		while (idx < sizeof(CarInfo))
		{
		  fread(file, strFromFile2);
		  split(strFromFile2, arrCoords, ',');
		  vehTrunk[idx][1] = strval(arrCoords[0]);
		  vehTrunkAmmo[idx][1] = strval(arrCoords[1]);
		  vehTrunk[idx][2] = strval(arrCoords[2]);
		  vehTrunkAmmo[idx][2] = strval(arrCoords[3]);
		  vehTrunk[idx][3] = strval(arrCoords[4]);
		  vehTrunkAmmo[idx][3] = strval(arrCoords[5]);
		  vehTrunk[idx][4] = strval(arrCoords[6]);
		  vehTrunkAmmo[idx][4] = strval(arrCoords[7]);
		  vehTrunkCounter[idx] = strval(arrCoords[8]);
		  vehTrunkArmour[idx] = floatstr(arrCoords[9]);
		  vehTrunkMats[idx] = floatstr(arrCoords[10]);
		  vehTrunkDrugs[idx] = floatstr(arrCoords[11]);
		  idx++;
		}
	}
	return 1;
}
Reply
#10

Just keep the Float: in for now...

Nevermind about "result" I thought that was a string.

I guess PlayerInfo[playerid][pDrugs] is an integer while vehTrunkDrugs[result] is a float.

Is that the case?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)