1 (edited by WASW 2009-01-16 18:53:12)

Topic: [MOD] Another Instagib for 0.5.0

Sorry, but i dont have utility for creating patches.

\src\game\server\gamecontroller.cpp:
find:
        subtype = WEAPON_NINJA;
        }

        if(type != -1)
        {

replace with:
        subtype = WEAPON_NINJA;
    }

    if(type != -1 && !config.sv_instagib)
    {



find:
void GAMECONTROLLER::on_character_spawn(class CHARACTER *chr)
{
    // default health
    chr->health = 10;

    // give default weapons
        chr->weapons[WEAPON_HAMMER].got = 1;
        chr->weapons[WEAPON_HAMMER].ammo = -1;
        chr->weapons[WEAPON_GUN].got = 1;
        chr->weapons[WEAPON_GUN].ammo = 10;
}

replace with:
void GAMECONTROLLER::on_character_spawn(class CHARACTER *chr)
{
    // default health
    chr->health = 10;
   
    // give default weapons
    if(config.sv_instagib)
    {
        chr->weapons[WEAPON_RIFLE].got = 1;
        chr->weapons[WEAPON_RIFLE].ammo = -1;
    }
    else
    {
        chr->weapons[WEAPON_HAMMER].got = 1;
        chr->weapons[WEAPON_HAMMER].ammo = -1;
        chr->weapons[WEAPON_GUN].got = 1;
        chr->weapons[WEAPON_GUN].ammo = 10;
    }
}



\src\game\server\entities\character.cpp:
find:
bool CHARACTER::spawn(PLAYER *player, vec2 pos, int team)
{
    player_state = PLAYERSTATE_UNKNOWN;
    emote_stop = -1;
    last_action = -1;
   

    active_weapon = WEAPON_GUN;
    last_weapon = WEAPON_HAMMER;
    queued_weapon = -1;

replace with:
bool CHARACTER::spawn(PLAYER *player, vec2 pos, int team)
{
    player_state = PLAYERSTATE_UNKNOWN;
    emote_stop = -1;
    last_action = -1;
   
    if(config.sv_instagib)
    {
        active_weapon = WEAPON_RIFLE;
        last_weapon = WEAPON_RIFLE;
        queued_weapon = -1;
    }
    else
    {
        active_weapon = WEAPON_GUN;
        last_weapon = WEAPON_HAMMER;
        queued_weapon = -1;
    }

find:
bool CHARACTER::take_damage(vec2 force, int dmg, int from, int weapon)
{
    core.vel += force;
   
    if(game.controller->is_friendly_fire(player->client_id, from) && !config.sv_teamdamage)
        return false;

replace with:
bool CHARACTER::take_damage(vec2 force, int dmg, int from, int weapon)
{
    core.vel += force;
   
    if(game.controller->is_friendly_fire(player->client_id, from) && !config.sv_teamdamage)
        return false;

    if(config.sv_instagib)
    {
        die(from, weapon);
        return false;
    }

and final action:
insert string MACRO_CONFIG_INT(sv_instagib, 0, 0, 1, CFGFLAG_SERVER, "") into \src\game\variables.hpp

Now compile it, add to server config file "sv_instagib 1" and play!

Windows binary and sources: download

2

Re: [MOD] Another Instagib for 0.5.0

Server with those modifications will be banned since it doesn't change the gametype tag.

spl0k, aka Al`. From the HuH clan.
Noobing pwns since 01/01/1970.
TeeViewer - TeeComp