Clearing the whole enum
#1

Hiho. I got a little problem, I would like to set the whole variables in enum of the player to false.

Код:
enum PlayerInfo
{
    pass[32],
    adminLvl,
	loggedIn,
	money,
	respekt,
	kills,
	deaths,
	owndeaths,
	skin,
	takedamage,
	Float:sp[4]
}; new player[MAX_PLAYERS][PlayerInfo];
How should I do this? Regards.
Reply
#2

If you haven't worked with the variables in the enum yet,they are already false/0
Reply
#3

It wasn't my question. I was asking how to set em to 0, I have already setted em to 1 or some string. -, -

Genius answer.
Reply
#4

He didn't know because you didn't specified that you already set them to 1.

Код:
player[ playerid ][ pass ][ 0 ] = EOS;
player[ playerid ][ adminLvl ] = 0;
player[ playerid ][ loggedIn ] = 0;
player[ playerid ][ money ] = 0;
player[ playerid ][ respekt ] = 0;
player[ playerid ][ kills ] = 0;
player[ playerid ][ deaths ] = 0;
player[ playerid ][ owndeaths ] = 0;
player[ playerid ][ skin ] = 0;
player[ playerid ][ takedamage ] = 0;
player[ playerid ][ sp ][ 0 ] = 0.0;
player[ playerid ][ sp ][ 1 ] = 0.0;
player[ playerid ][ sp ][ 2 ] = 0.0;
player[ playerid ][ sp ][ 3 ] = 0.0;
Reply
#5

So there's no way to do this faster, than variable by variable?
Reply
#6

Quote:
Originally Posted by IgrexolonO
Посмотреть сообщение
So there's no way to do this faster, than variable by variable?
No, there's no way AFAIK.
Reply
#7

You can do this :


pawn Код:
for(new x = 0; x < (_:PlayerInfo); x++)
    {
        player[playerid][PlayerInfo:x] = 0;
    }


I hope that i have helped .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)