setting/getting cash
Hey all,
I'm trying to write a basic SourceMM CS:S plugin to set a player's cash to 0 if they switch to spectator and back to get more money. It's just the setting cash part left at this stage. How is this best done? I've read through BAILOPAN's "finding functions" devlog tutorials, but I'm not sure if this is actually how I should do it, or if I'm looking in the wrong place. :roll: I saw a thread regarding money offsets. I assume that's for just editing the relevant memory location directly? If so, is the offset from each player's edict_t*? I also have included cbase.h just to see if I could; I doubt this will help though, since cash is a CS:S specific property, right? Any help will be greatly appreciated. |
Ok, after a bit more looking around I've got:
Code:
edict_t *pEntity = m_Engine->PEntityOfEntIndex(index); |
Ok, I got a setcash function working fine.
However, there's a problem. It appears the correct player_team event is fired when the user chooses a team, but the player is only given the amount of money specified in mp_startmoney when he or she selects a model. Which would be fine except that no event seems to be fired when a model is selected. :( I'll have to just do -800 cash on round_start. |
You could use ClientCommand() and listen for "joinclass":
Code:
void Whatever::ClientCommand(edict_t *entity) |
All times are GMT -4. The time now is 12:58. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.