Raised This Month: $ Target: $400
 0% 

Dynamic Array help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
TheDOO
Member
Join Date: Nov 2007
Old 03-24-2009 , 20:51   Dynamic Array help
Reply With Quote #1

Ok, well right now I have a plugin that stores damage that is done to an entity by a player into an array.

Right now the array is defined as:
Code:
gDamageDone[ MAX_PLAYERS + 1][ 4381 ]
I would like not having to declare a large array like that, so I want the 2nd dimension to be dynamic, depending on the amount of entities in the current map.

Now I understand that I would probably use CellArray, but I am unsure how to go about doing this and still use the array like I do, example:
Code:
public Event_MonsterTakeDamage( idEnt, idInflictor, idAttacker, Float:damage, damageBits )
{
     ... stuff here
     
     gDamageDone[ idAttacker ][ idEnt ] += damage
}

Last edited by TheDOO; 03-24-2009 at 20:56.
TheDOO is offline
 


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 09:00.


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