25.04.2010, 19:13
In the past I used to reset the player data by this way:
But it takes too long to add because there are a lot of cells for "Var". Then I thought, what if I use a loop? so I tried this:
But it returns an error.
Is there a way to do what I want?
pawn Код:
ResetPlayerData(playerid)
{
Var[playerid][ID] = 0;
Var[playerid][Name] = EOS;
}
pawn Код:
ResetPlayerData(playerid)
{
for(new i = 0; i < MAX_P_VAR; i ++)
{
switch(i)
{
case 1..8: Var[playerid][i] = EOS; // this line error
case 9, 15, 20: Var[playerid][i] = -1; // if I added this it would show another error
}
}
}
Код:
mygm.pwn(168) : warning 213: tag mismatch