Re: what happends when game ends? -
08-11-2004
When game ends, you mean...
- when the SERVER shuts down (or when the map is changed) ?
- when the ROUND restarts (in round-based games such as Counter-Strike ?)
For the 1st one, hook the ServerDeactivate() function ; for the second one, it all depends on the way the mod authors implemented their round system. Usually a network message is sent to clients to synchronize the restart. Find this message and hook it.
Players frags are usually stored in pEdict->v.frags. It's the common place to store it but note that some mods may decide to store it elsewhere (as about any other variables in there, actually...)
Player deaths are usually stored in the entitie's private data (pEdict->pvPrivateData + offset), which you can't access without the mod's source code, or without a bit of reverse-engineering to find out the offset in memory where it is. A more convenient solution is to keep track of these events internally as they occur.
RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
Last edited by Pierre-Marie Baty; 08-11-2004 at 18:38..
|