Here's a Small Tutorial that will make the grenade launcher shoot 2 grenades side by side and also takes off the correct amount of ammo.
Also Makes them stronger but the downside is it takes 5 seconds to blow up.
You will need Visual C++ for this is what i used to do this.
|
Step 1
Open up p_weapon.c and scroll down until you see
"void weapon_grenadelauncher_fire (edict_t *ent)"
Delete that code and replace it with this one.
Then Compile the DLL and run it get the Grenade Launcher
and Blow the hell out of monsters.
void weapon_grenadelauncher_fire (edict_t *ent)
{
vec3_t offset;
vec3_t forward, right;
vec3_t start;
int damage = 120;
float radius;
radius = damage+=200;
if (is_quad)
damage *= 4;
VectorSet(offset, 8, 8, ent->viewheight-8);
AngleVectors (ent->client->v_angle, forward, right, NULL);
P_ProjectSource (ent->client, ent->s.origin, offset, forward, right, start);
VectorScale (forward, -2, ent->client->kick_origin);
ent->client->kick_angles[0] = -1;
fire_grenade (ent, start, forward, damage, 600, 5, radius);
VectorSet(offset, 8, 20, ent->viewheight-8);
AngleVectors (ent->client->v_angle, forward, right, NULL);
P_ProjectSource (ent->client, ent->s.origin, offset, forward, right, start);
VectorScale (forward, -2, ent->client->kick_origin);
ent->client->kick_angles[0] = -1;
fire_grenade (ent, start, forward, damage, 600, 5, radius);
gi.WriteByte (svc_muzzleflash);
gi.WriteShort (ent-g_edicts);
gi.WriteByte (MZ_GRENADE | is_silenced);
gi.multicast (ent->s.origin, MULTICAST_PVS);
ent->client->ps.gunframe++;
PlayerNoise(ent, start, PNOISE_WEAPON);
ent->client->pers.inventory[ent->client->ammo_index] -= ent->client->pers.weapon->quantity;
ent->client->pers.inventory[ent->client->ammo_index] -= ent->client->pers.weapon->quantity;
}
|
|
Ending
Now here's what i did:
To do more damage i just edited this line:
radius = damage+=200;
To change the damage just change the 200 to what ever you want it to be.
To Make them come out side by side i just edited this section:
VectorSet(offset, 8, 8, ent->viewheight-8);
AngleVectors (ent->client->v_angle, forward, right, NULL);
P_ProjectSource (ent->client, ent->s.origin, offset, forward, right, start);
VectorScale (forward, -2, ent->client->kick_origin);
ent->client->kick_angles[0] = -1;
fire_grenade (ent, start, forward, damage, 600, 5, radius);
I basicly double that code one after another. Then you need to edit the line:
VectorSet(offset, 8, 8, ent->viewheight-8);
Now for the first grenade you leave it the same but for the second grenade change the SECOND 8 to about 20.
Now for The CurrentAmmo:
I just added an extra line instead of the just 1 now there will be 2 lines of this:
ent->client->pers.inventory[ent->client->ammo_index] -= ent->client->pers.weapon->quantity;
|
|