Okay so I was working on a npc version for telekill because the way I have the regular telekill setup makes it confusing when combing them. So I have this but when i turn it on, it crashes. I have been looking at other examples and stuff but i cant figure it out. So if anyone wants to help feel free.
Well the code doesnt look wrong but I made a better solution:
Put a check for FireTeam in a GetNearestPlayer function, and just let it return the id of the character (not player!)
Then you have 1 single function for 2 features:
Code:
int ID = GetNearestIndex(false, true);
if(ID != -1)
{
cCharacterFX *pFX = (cCharacterFX*)pSFXMgr->SFXList[SFX_CHARACTER].List[ID];
}
Originally Posted by Ch40zz-C0d3r
Well the code doesnt look wrong but I made a better solution:
Put a check for FireTeam in a GetNearestPlayer function, and just let it return the id of the character (not player!)
Then you have 1 single function for 2 features:
Code:
int ID = GetNearestIndex(false, true);
if(ID != -1)
{
cCharacterFX *pFX = (cCharacterFX*)pSFXMgr->SFXList[SFX_CHARACTER].List[ID];
}
Its still crashing... Maybe my classes are wrong...
Originally Posted by Skaterforeva1
Its still crashing... Maybe my classes are wrong...
I would recommend getting your target position from a bone transform result as im not sure if you can call position directly or not, cant remember because ive always done it by bone. Also remember to do what chaos said aswell as its not gonna work very well without a target calculation and you needa have .List[ID]; on the end.
Oh and for your loop:
Code:
int numplayers = SFXMgr->SFXList[SFX_CHARACTER].Num
I would recommend getting your target position from a bone transform result as im not sure if you can call position directly or not, cant remember because ive always done it by bone. Also remember to do what chaos said aswell as its not gonna work very well without a target calculation and you needa have .List[ID]; on the end.
Oh and for your loop:
Code:
int numplayers = SFXMgr->SFXList[SFX_CHARACTER].Num