cycle and enum
#1

Hello,
i write this code:

Код:
enum PLAYER_INFO
{
	money,//0
	bank,//1
	weapon1,//2
	weapon2,//3
	weapon3//4
}
new Player[MAX_PLAYERS][PLAYER_INFO];

public OnPlayerConnect(playerid)
{
	for(new i;i<sizeof(Player);i++)
	{
	    Player[playerid][i] = 0;//warning 213: tag mismatch
	}
	return 1;
}
warning 213: tag mismatch

How do I properly write to the cycle?
Reply
#2

pawn Код:
Player[playerid][PLAYER_INFO:i] = 0;
I hope you know what you are doing, because it's not a way to loop through an enum.

Also I'd recommend using memset for this case.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)