HELP!! #define macros value with 2D arrays player data
PHP Code:
PHP Code:
|
Re: HELP!! #define macros value with 2D arrays player data
Quote:
|
Re: HELP!! #define macros value with 2D arrays player data
Yes , but shouldn't we have 32 columns for 32 player (rows) , or we don't need to 32 columns for the 32 rows.sorry for the dumb question.
|
Re: HELP!! #define macros value with 2D arrays player data
Quote:
|
Re: HELP!! #define macros value with 2D arrays player data
I don't know , I'm stupid :D I thought that you need 32 columns , since it has 32 players with rows.
|
Re: HELP!! #define macros value with 2D arrays player data
so you have p_data[33] starting from 0 to 32 (the last is EOS, if you will use p_data[33] = 15 you will get an index out of bounds in server console).
players id are starting from 1 to 32, that means p_data[1] is the first player that join the server and so on. your variable is defined p_data[33][P_LAST] where P_LAST = 24 (last value that can t be used), the numbers from 0 that 23 are powers. for texample you want to print in console the current xp of the player that joined on the server and has id 13. not using the defined macros, you should use the variable like p_data[13][6] and you will get his XP. in this case, the author of the plugin used the macros to not memorize numbers for every power so he will use in code p_data[13][P_XP] |
Re: HELP!! #define macros value with 2D arrays player data
i'm not sure is that because can you explain this.
#define P_SHOWICONS 9 #define P_SERPENTCOUNT 19 Quote:
Quote:
|
Re: HELP!! #define macros value with 2D arrays player data
yes, the ninth slot of the arrray is reserved for P_SHOWICONS
PHP Code:
PHP Code:
|
Re: HELP!! #define macros value with 2D arrays player data
Yes is it big plugin Warcraft 3 mod , so those #define marcos values are just to make more easy to memorize the numbers in COLUMNS , because I'm trying to create my own warcraft 3 zombie mod for biohazard.
I don't need to create array with [33] rows and [32] columns for players in the server.Just how many columns as i wish ?? |
Re: HELP!! #define macros value with 2D arrays player data
you must create an array with 33 rows (that means MAX_PLAYERS + 1 in below code) to store players id and have different values of that array for every player
this is how i would start it, maybe this help you PHP Code:
|
| All times are GMT -4. The time now is 15:35. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.