Questions
#2

1) You can't alter the ways arrays process, but you can add +1 to the size of one of your dimensions for your array, and avoid using 0. For example:

pawn Code:
new E_PLAYERS[MAX_PLAYERS+1];
E_PLAYERS[1] = 42; // (or 0+1 instead of 1)
This isn't wise though, because you'll be wasting at least 4 bytes of memory for every item in your array. (I'm generally referring to use of this with an enum, but even if not - you're still wasting 4 bytes for just a single dimension.)

2) If you want to reset the value of an integer, you can always just set its value to 0. When you create an integer, the default value for it is 0. For strings, you can use strdel, set the value of your string to nothing with format or insert a null character for cell 0.
Reply


Messages In This Thread
Questions - by Cowboy - 02.08.2011, 14:58
Re: Questions - by Calgon - 02.08.2011, 15:02
Re: Questions - by Cowboy - 02.08.2011, 15:04
Re: Questions - by Calgon - 02.08.2011, 15:07
Re: Questions - by Cowboy - 02.08.2011, 15:10
Re: Questions - by Calgon - 02.08.2011, 15:15

Forum Jump:


Users browsing this thread: 1 Guest(s)