30 Jul 10, 12:55AM
Alright, let me be honest. If you really really want to make a mod, only a handful of people here would be helpful. The rest just discourages you. Don't forget that this is mainly a gaming forum, not a programmer's forum.
Anyways, the reason you can't do it there is that "playerstate" doesn't store the data about which team the player is on. "playerent" which is a derived class from "playerstate" is the one you should be looking for.
In the same file (entity.h) scroll down further and you should be able to find the class "playerent". There, you can find the respawn function:
Over there, insert this:
By what you're trying to do, I'm guessing you're doing a zombie mod. Am I right? ;)
Anyways, the reason you can't do it there is that "playerstate" doesn't store the data about which team the player is on. "playerent" which is a derived class from "playerstate" is the one you should be looking for.
In the same file (entity.h) scroll down further and you should be able to find the class "playerent". There, you can find the respawn function:
[SELECT ALL] Code:
void respawn()
{
dynent::reset();
playerstate::respawn();
history.reset();
if(weaponsel) weaponsel->reset();
lastaction = 0;
lastattackweapon = NULL;
attacking = false;
weaponchanging = 0;
resetspec();
eardamagemillis = 0;
eyeheight = maxeyeheight;
curskin = nextskin[team_base(team)];
}
Over there, insert this:
[SELECT ALL] Code:
if (team == TEAM_CLA || team == TEAM_CLA_SPECT)
health = 2000;
By what you're trying to do, I'm guessing you're doing a zombie mod. Am I right? ;)