Once More array issue
I have these arrays
PHP Code:
PHP Code:
PHP Code:
How can i make it work by defining ARRAY size...? Because sometimes in the server sends me an error about the array is out of bounds.. and etc. |
Re: Once More array issue
What do you want to do exactly? You define the array as 2D-imensional new XYZ[][] and after that you want to set its value only to a first dimension XYZ[]++, you can't do that.
new XYZ[][]; XYZ[0][0]++; new XYZ[]; XYZ[0]++; <-- This is what you'r looking for. |
Re: Once More array issue
In the ddimension.inc that you can add more than 3 dimensions to an array I'm Using it like this
c{ new _:PlayerData[ MAXPLAYERS ][ Score ][ 3 ][ 3 ]}; c{ new _:g_RoundData[MAXPLAYERS][MAXPLAYERS][3][3][Score][3][5]}; //[Killer][Victim][HitPlace][WeaponIndex][Type][Round][Array Size] ;Number c{ new _:g_WeaponData[MAXPLAYERS][3][Score][3][4]}; //[Killer][WeaponIndex][Type][Round][Array Size] ;Number c{ new _:g_WeaponDamage[MAXPLAYERS][3][g_DType][3][4]}; //[Killer][WeaponIndex][Type][Round][Array Size] ;Damage c{ new _:g_HitPlaceDamage[MAXPLAYERS][MAXPLAYERS][3][3][g_DType][3][5]}; //[Killer][Victim][HitPlace][WeaponIndex][Type][Round][Array Size] ;Damage And Then d{PlayerData[g_PlayerIDs[g_defuser]][XP][1]}-=15; WORKS |
Re: Once More array issue
You can only have 3 dimensions in an array. Also, you can't set a value individually to each dimension.
You should have a data structure. Something like: Code:
Note that you would not need Victim in the data because you would use g_aRoundData[ index ] and then fill the other pieces of data accordingly. EDIT: Are you using Post #1 or Post #3 ? |
Re: Once More array issue
PHP Code:
|
| All times are GMT -4. The time now is 15:15. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.