.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Common Questions (http://forums.bots-united.com/forumdisplay.php?f=51)
-   -   Money in CS (http://forums.bots-united.com/showthread.php?t=5741)

VenoM UT 01-10-2006 22:32

Money in CS
 
Hi, does anyone know which variable in edict holds the money in CS? Is it in v somewhere? I tried v.impulse but couldn't find it...

KWo 01-10-2006 22:51

Re: Money in CS
 
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_destint msg_type, const float *pOriginedict_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 *pint 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]; 


VenoM UT 02-10-2006 18:47

Re: Money in CS
 
:) well, that explains why I didn't understand a thing when I looked at the raw code. Dissappointing isn't it? That you can't alter the money the same way as you can alter health or armor... Btw, I was kinda trying a practice mode style gameplay in the bot, so that's why I was asking this.. I found the health variable, and now I can practice in "near" god mode w/o having to wait until next round, going into a den of terrorists alone in rambo style :D


All times are GMT +2. The time now is 09:10.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.