Raised This Month: $12 Target: $400
 3% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
wEr3
Junior Member
Join Date: Jun 2017
Old 09-11-2022 , 19:17   Re: HELP!! #define macros value with 2D arrays player data
Reply With Quote #11

Thanks so much , I will try to create it , is it big plugin with race and xp.
Can i create like that , like they did or to create myself
i WANT TO INNOVATE my vision in my head.

Quote:
#define MAX_NAME_LENGTH 32
#define MAX_VAR_LENGTH 64
#define RACE_SKILL_LENGTH 64
#define RACE_SKILL_LENGTH_F 63
#define RACE_NAME_LENGTH 64
#define RACE_NAME_LENGTH_F 63
#define ITEM_NAME_LENGTH 64
#define ITEM_NAME_LENGTH_F 63
#define SHORT_RACE_NAME_LENGTH 16
#define SHORT_RACE_NAME_LENGTH_F 15
#define SHORT_ITEM_NAME_LENGTH 32
#define SHORT_ITEM_NAME_LENGTH_F 31
Quote:
// ********************************************* ******************************
// Start of variables
// ********************************************* ******************************

// Use this everywhere instead of declaring it in each function (compiles faster)
new szTmpMsg[2048];

// This keeps track of which races were given "free" XP - we don't want to save this XP to the database
new bool:g_bGivenLevel10[33][MAX_RACES+1]; // Stores if we gave them level 10

new g_GlowLevel[33][4];

// Used for Chameleon
new g_ChamSkills[5];

new p_data[33][P_LAST] // Contains player data
new bool:p_data_b[33][PB_LAST] // Contains player data of type boolean

// Used for advanced statistics
new iStatsHead[33][MAX_CSW_S]
new iStatsChest[33][MAX_CSW_S]
new iStatsStomach[33][MAX_CSW_S]
new iStatsLeftArm[33][MAX_CSW_S]
new iStatsRightArm[33][MAX_CSW_S]
new iStatsLeftLeg[33][MAX_CSW_S]
new iStatsRightLeg[33][MAX_CSW_S]
new iStatsKills[33][MAX_CSW_S]
new iStatsDeaths[33][MAX_CSW_S]
new iStatsHS[33][MAX_CSW_S]
new iStatsTKS[33][MAX_CSW_S]
new iStatsShots[33][MAX_CSW_S]
new iStatsHits[33][MAX_CSW_S]
new iStatsDamage[33][MAX_CSW_S]

new MAXPLAYERS

// Used by admin menu
new g_menuPosition[33]
new g_menuPlayers[33][32]
new g_menuPlayersNum[33]
new g_menuOption[33]
new g_menuSettings[33]

new gmsgStatusText
new gmsgBarTime

// Used with SHARED_SetUserSpeed
new bool:g_bPlayerZoomed[33];

new szSpawnEnt[2][32];

/* START - CSTRIKE VARIABLES */
new bool:g_freezeTime = false;
new bool:g_buyTime



wEr3 is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 09-11-2022 , 20:48   Re: HELP!! #define macros value with 2D arrays player data
Reply With Quote #12

i don t know what you want to achieve.

i would start it from scratch and adapt some functions from it to my pluign
lexzor is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-13-2022 , 07:16   Re: HELP!! #define macros value with 2D arrays player data
Reply With Quote #13

PHP Code:
#define SIZE_3RD 8
#define SIZE_4TH 3

// This for accessing the cells for the 4th dimension
#define 4DArray[%1][%2][%3][%4] [%1][%2][%3 + (((SIZE_3RD * SIZE_4TH) / SIZE_4TH) * %4)]

// This for initializing the 4th d array...
#define 4DInitArray[%1][%2][%3][%4] [%1][%2][ (%3 * %4) ]

new g_stuff_4DInitArray[33][10][SIZE_3RD][SIZE_4TH]

// accessing 4thD....
g_stuff_4DArray[0][0][0][0]; 
That's how you create a 4th dimension array
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 09-13-2022 at 07:42.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Reply


Thread Tools
Display Modes

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 17:04.


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