21.07.2011, 16:30
is there an easy way to erase everything in an enum without doing
for the whole thing?
pawn Код:
enum[VALUE1] = 0;
enum[VALUE2] = 0;
enum[VALUE1] = 0;
enum[VALUE2] = 0;
for(new i = 0; i < sizeof(enum); i++)
enum[enumname:i] = 0;
}
enum eEnum
{
eVar1,
eVar2,
eVar3
}
new MyVar[eEnum];
for(new i=0; i < sizeof(MyVar); i++)
{
MyVar[eEnum:i] = 0;
}
gPlayerInfo[playerid][PASSWORD]
enum Example
{
xD,
xO,
xP,
};
new Var[Example];
xD = 5;
xO = 4;
new Var[xD] = 0;
new Var[xO] = 0;
new Var[xP] = 0;
for(new y = 0; y != sizeof(Var); y++)
{
Var[Example:y] = 0; //The tag "Example:" is derived from the enum "Example"
}
then how would i clear the array if it was setup like
pawn Код:
|
strmid(gPlayerInfo[playerid][PASSWORD],"",false,0,32);
new var[enum];
for (new i = 0; i < sizeof(var); i++)
{
if (sizeof(var[enum:i]) > 1)
{
for (new j = 0; j < sizeof(var[enum:i]); j ++)
{
var[enum:i][j] = 0;
} else {
var[enum:i] = 0;
}
}
}
enum E_VAR {
var1,
var2[10],
var3
}
new var[E_VAR];
for(new i; i < sizeof(var); i++) {
var[E_VAR: i] = 0;
}