Is this an array? How does this work?
#1

https://sampforum.blast.hk/showthread.php?tid=581336
On the first code that he wrote, he created an enum and a PlayerInfo object, is it a multi dimensional array? How does this even work? I am having an hard time understanding the part with the enum and the PlayerInfo, the rest is clear.
Reply
#2

Yes. An enumeration defines a set of constants. It is actually very similar to doing:
PHP код:
#define pName 0 // start at index 0 and reserve another 23 indices
#define pPassword 24 // start at slot 24 and reserve another 64 indices
#define pSalt 88 // start at index 88 and reserve another 10 indices
#define pInfo 98 // total number of indices + 1

new PlayerInfo[MAX_PLAYERS][pInfo]; 
Although the enumeration is obviously much easier to construct since you don't have to perform any calculations yourself.
Reply
#3

EDIT: Nevermind, I think I got it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)