SA-MP Forums Archive
Warning but works - 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: Warning but works (/showthread.php?tid=561293)



Warning but works - ProjectMan - 02.02.2015

Hello I have this code:

pawn Код:
enum pInfos
{
    aTest1, //1
    aTest2, //2
    aTest3 //3
}
Somewhere in the code, I want to use it like this:

pawn Код:
for (new i = 0; i < pInfos; i++)
It works (returns 3 which is the enum count), But gives Tag Mismatch warning. How do I get rid of this warning?


Re: Warning but works - BroZeus - 02.02.2015

use
pawn Код:
for (new i = 0; i < _:pInfos; i++)



Re: Warning but works - ProjectMan - 02.02.2015

Quote:
Originally Posted by BroZeus
Посмотреть сообщение
use
pawn Код:
for (new i = 0; i < _:pInfos; i++)
Oh wow. Works great. Now I have one more Tag Mismatch warning.

There is this:

pawn Код:
new PlayerInfo[MAX_PLAYERS][pInfos];
So I want to use it like this:

pawn Код:
if (PlayerInfo[playerid][i] == 0)



Re: Warning but works - ProjectMan - 02.02.2015

Bumper sticker.


Re: Warning but works - ProjectMan - 02.02.2015

To clarify: Here's the code:

pawn Код:
enum pInfos
{
    aTest1, //1
    aTest2, //2
    aTest3 //3
}
new PlayerInfo[MAX_PLAYERS][pInfos];


...

for (new i = 0; i < _:pInfos; i++)
{
if (PlayerInfo[playerid][i] == 0) //Tag mismatch warning because of [i]
{
...