Raised This Month: $ Target: $400
 0% 

HELP!! #define macros value with 2D arrays player data


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
lexzor
Veteran Member
Join Date: Nov 2020
Old 09-10-2022 , 19:50   Re: HELP!! #define macros value with 2D arrays player data
Reply With Quote #6

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]
lexzor is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:35.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode