How would OnTakeDamageAlive have entity out of bounds?
int g_cEXPREF[MAXPLAYERS + 1] = { -1, ... };
## Another function ## int ExplosionIndex = CreateEntityByName("env_explosion"); g_cEXPREF[client] = EntIndexToEntRef(ExplosionIndex); ## # Here I'm checking that an explosion is equal to a Ref I set to the client array earlier during creation of the explosion entity. So I'm checking that THIS explosion is the same one set earlier public Action OnTakeDamageAlive(int iVictim, int &iAttacker, int &inflictor, float &damage, int &damagetype, int &weapon, float damageForce[3], float damagePosition[3]) { int iRef = EntIndexToEntRef(inflictor); if(iRef == g_cEXPREF[iAttacker]) .... } It's throwing this: L 09/11/2018 - 06:31:34: [SM] Exception reported: Array index out-of-bounds (index 87, limit 66) |
Re: How would OnTakeDamageAlive have entity out of bounds?
Ohhhhhh. It's something OTHER than a player doing damage. So the iAttacker is an object entity. I just need to do a IsPlayer check?
|
Re: How would OnTakeDamageAlive have entity out of bounds?
Quote:
inflictor = entity that was used to attack iVictim (inflictor > 1 && inflictor < 2049) or -1 if there was no inflictor sometimes pops up for me Someone murdered a person is the inflictor responsible and goes to jail or does the person holding it? |
All times are GMT -4. The time now is 01:51. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.