And somewhere later on to check if they have a specific knife
PHP Code:
if(g_PlayerKnives[id] & Knife_First)
{
// They have the first knife
}
if(g_PlayerKnives[id] & (Knife_Second | Knife_Third))
{
// They have at least the second or third knife
}
if(g_PlayerKnives[id] & (Knife_Second | Knife_Third) == (Knife_Second | Knife_Third))
{
// They have both the second and third knives
}
Search and read up on a few tutorials on bitsums and bit arithmetic around AlliedModders (or even somewhere else). There you will most likely find some useful macros to make it easier for you to deal with bitsums.
g_PlayerKnives[id] |= Knife_First; that gives me an error