I'm attempting to use the GetPlayerWeaponSlot function to get the index of a client's primary weapon, but it keeps passing back seemingly nonsensical values. Here's the block I'm using to test this:
Code:
public void TF2_OnConditionAdded(int client, TFCond addedCond) {
int primaryIndex = GetPlayerWeaponSlot(client, TFWeaponSlot_Primary);
char buffer[32];
IntToString(revolverIndex, buffer, 32);
PrintToServer(buffer);
}
So far, I've been handed 977 with the Diamondback and Ambassador, 975 with the stock revolver and the Cow Mangler, 975 (i think?) with the Machina, and 17 and 987 (either or) with the stock sniper rifle. I have no idea what these numbers mean or how I can make them consistent. I'm new to SP, and if anyone has some insight on how I'm misusing this function, please lend me a hand