Well it compiled fine, but it's returning XP 0. I'm guessing the 2da string isn't referencing the table correctly. I'm not sure whether it's the row or the column, though. Would GetCharacterLevel(OBJECT_SELF) - 1 work better? Or maybe the GetChallengeRating string isn't referencing the columns?
I'm pretty sure the GetChallengeRating isn't working, because if it returns a solid integer (which I'm not even sure it does, maybe decimal?) it's probably looking for the column by string and not integer. But the xptables.2da columns are Level, C0, C1, C2, etc. So if it is an integer, I still need to add a C to the front of it, right?
Edit: I added some SendMessageToPC strings so that I could see what getchallengerating and pwfxp_getlevel were spitting out. pwfxp_getlevel is working as intended, while getchallengerating is giving 0.500000000 for CR0 and 1.000000000 for CR1, 2.000000000, etc, etc.
Edit2: Problem Solved. The new code reads:
string ChCol="C"+IntToString(FloatToInt(GetChallengeRating(oDead)));
int LvRow=PWFXP_GetLevel(oGroupMbr) - 1;
int bXP=StringToInt(Get2DAString("xptable",ChCol,LvRow));
Thanks for the help everybody.
Modifié par Jlad, 21 octobre 2010 - 12:28 .