Dynamic Array help
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 ]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 ) |
Re: Dynamic Array help
I haven't used the dynamic arrays yet. But I will just give you a typ.
gDamageDone[ MAX_PLAYERS + 1][ 4381 ] -> gDamageDone[ MAX_PLAYERS + 1][ 1126 ] The engine supports something like 1126 entities. You don't need 4381 o.O. |
Re: Dynamic Array help
Quote:
|
Re: Dynamic Array help
The switch name is : -num_edicts
Quote:
You can define a custom and higher number with the swith : -num_edicts |
Re: Dynamic Array help
Quote:
|
Re: Dynamic Array help
Yeah my -num_edicts is at 4096 then I used:
Code:
global_get(glb_maxEntities) |
Re: Dynamic Array help
I think that we need a diferent aproach.
I suggest doing something like this: PHP Code:
|
Re: Dynamic Array help
Quote:
Code:
gDamageDone[ idAttacker ][ idEnt ] += damage;Code:
... stuff here |
Re: Dynamic Array help
1 Attachment(s)
Using dynamic arrays for this would be kinda unefficient:
Quote:
Code:
|
Re: Dynamic Array help
@MeRcyLeZZ: You should create a var to store get_maxplayers()'s value because the loop will execute it every time the loop's condition is being checked.
|
| All times are GMT -4. The time now is 09:00. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.