--
[ Picked text/plain from multipart/alternative ]
Or (CBasePlayer *)GetClassPtr(pevAttacker);
At 17:00 12/12/2002, you wrote:
>Might want to try (CBasePlayer*)(CBasePlayer::Instance( pevAttacker ))
>instead.
>
>Persuter
>
>At 09:01 PM 12/11/2002 +00-03, you wrote:
>>I'd been working on coding out a money system for a while now, and recently
>>began work on having monsters give you money everytime you kill them. This
>>is where I'm having troubles. Botman suggested the following in
>>CBaseMonster::Killed in combat.cpp
>>
>>CBasePlayer *pPlayer = GetClassPtr((CBasePlayer *)pevAttacker);
>>// is it a player (and not a grenade, hornet, rocket, etc.)?
>>if (pPlayer->IsPlayer())
>>{
>>pPlayer->m_Money += m_MosterMoneyValue;
>>}
>>
>>In my mind, I thought this would work, I've tried it though and I find that
>>pPlayer isn't referencing the player properly, and therefore m_Money (which
>>exists in player.h under class CBasePlayer : public CBaseMonster), stays at
>>zero (I've used alert (at_console) in my code to check this). Any ideas
>>anyone?
>>
>>_______________________________________________
>>To unsubscribe, edit your list preferences, or view the list archives,
>>please visit:
>>http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>_______________________________________________
>To unsubscribe, edit your list preferences, or view the list archives,
>please visit:
>http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
----------
Programmer and Modeller for <http://pokemod.fragoff.net/>The
<http://pokemod.fragoff.net/>Pokemod
----------
--
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders