I don't think it's edict_t keeping money. We are using catching HL messages to get info about the money...
PHP Code:
void pfnMessageBegin (int msg_dest, int msg_type, const float *pOrigin, edict_t *ed)
{
// Called each Time a Message is about to sent
int index;
int tab_index;
botMsgFunction = NULL; // no msg function until known otherwise
state = 0;
// Bot involved ?
if (!FNullEnt (ed))
{
index = ENTINDEX (ed) - 1;
// is this message for a bot?
if ((index >= 0) && (index < gpGlobals->maxClients) && (bots[index].pEdict == ed))
{
botMsgIndex = index; // index of bot receiving message
// Message handling is done in bot_client.cpp
if (msg_type == GET_USER_MSG_ID (PLID, "AmmoPickup", NULL))
botMsgFunction = BotClient_CS_AmmoPickup;
(...)
else if (msg_type == GET_USER_MSG_ID (PLID, "Money", NULL))
botMsgFunction = BotClient_CS_Money;
(...)
}
void BotClient_CS_Money (void *p, int bot_index)
{
// This message gets sent when the bots money ammount changes
if (state == 0)
bots[bot_index].bot_money = *(int *) p; // amount of money
}
AMX X hacks private data to set money for the player:
PHP Code:
// Give money
*((int *)pPlayer->pvPrivateData + OFFSET_CSMONEY) = params[2];