How do I change protocol for a modded server?
#23
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:

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:

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? ;)
Thanks given by:


Messages In This Thread
RE: HELP please - by Lightning - 25 Jul 10, 05:35PM
RE: HELP please - by [3D][Raver] - 25 Jul 10, 05:36PM
RE: HELP please - by Brahma - 25 Jul 10, 06:13PM
RE: HELP please - by [3D][Raver] - 25 Jul 10, 06:16PM
RE: HELP please - by [3D][Raver] - 26 Jul 10, 03:02AM
RE: How do I change protocol for a modded server? - by LeeZH - 30 Jul 10, 12:55AM