No More Backpacks
Created By: | Marius |
eMail: | lordshoel@yahoo.com |
Difficulty Scale: | Easy |
item.ammo_shells = self.ammo_shells; item.ammo_nails = self.ammo_nails; item.ammo_rockets = self.ammo_rockets; item.ammo_cells = self.ammo_cells;Ok, found it? If you have then delete it. What it did is set tha ammo contained in the backpack to that of the player the dropped it. With it gone there should nolonger be a ammo filled pack.
item.nextthink = time + 120; // remove after 2 minutes item.think = SUB_Remove;What it does is set the time for it to remain. Change it so it should be as below:
//Set as you like, between 30-60 secs is good item.nextthink = time + 60; item.think = SUB_Remove;Congradulations, the easy part is almost done. Find the following lines in DropBackpack:
setmodel (item, "progs/backpack.mdl"); setsize (item, '-16 -16 0', '16 16 56');Found it? If you have delete the setmodel statement and the setsize. This means we need to add some new models, thats Step 3, save and continue.
item.items = self.weapon; if (item.items == IT_AXE) item.netname = "Axe"; else if (item.items == IT_SHOTGUN) item.netname = "Shotgun"; else if (item.items == IT_SUPER_SHOTGUN) item.netname = "Double-barrelled Shotgun"; else if (item.items == IT_NAILGUN) item.netname = "Nailgun"; else if (item.items == IT_SUPER_NAILGUN) item.netname = "Super Nailgun"; else if (item.items == IT_GRENADE_LAUNCHER) item.netname = "Grenade Launcher"; else if (item.items == IT_ROCKET_LAUNCHER) item.netname = "Rocket Launcher"; else if (item.items == IT_LIGHTNING) item.netname = "Thunderbolt"; else item.netname = "";Now that you have found it delete it and replace it with the below code:
item.items = self.weapon; if (item.items == IT_AXE) { return; //No point in receiving an Axe ? } else if (item.items == IT_SHOTGUN) { setmodel (item, "progs/shotgun.mdl"); setsize (item, '-16 -16 0', '16 16 56'); item.ammo_shells = 10; item.netname = "Shotgun"; } else if (item.items == IT_SUPER_SHOTGUN) { setmodel (item, "progs/g_shot.mdl"); setsize (item, '-16 -16 0', '16 16 56'); item.ammo_shells = 10; item.netname = "Double-barrelled Shotgun"; } else if (item.items == IT_NAILGUN) { setmodel (item, "progs/g_nail.mdl"); setsize (item, '-16 -16 0', '16 16 56'); item.ammo_nails = 25; item.netname = "Nailgun"; } else if (item.items == IT_SUPER_NAILGUN) { setmodel (item, "progs/g_nail2.mdl"); setsize (item, '-16 -16 0', '16 16 56'); item.ammo_nails = 25; item.netname = "Super Nailgun"; } else if (item.items == IT_GRENADE_LAUNCHER) { setmodel (item, "progs/g_rock.mdl"); setsize (item, '-16 -16 0', '16 16 56'); item.ammo_rockets = 10; item.netname = "Grenade Launcher"; } else if (item.items == IT_ROCKET_LAUNCHER) { setmodel (item, "progs/g_rock2.mdl"); setsize (item, '-16 -16 0', '16 16 56'); item.ammo_rockets = 10; item.netname = "Rocket Launcher"; } else if (item.items == IT_LIGHTNING) { setmodel (item, "progs/g_light.mdl"); setsize (item, '-16 -16 0', '16 16 56'); item.ammo_cells = 15; item.netname = "Thunderbolt"; }Now to explain what it does.
else if (item.items == IT_LIGHTNING) - If Lightning Gun then do brackets { setmodel (item, "progs/g_light.mdl"); - Sets model for the Lightning Gun setsize (item, '-16 -16 0', '16 16 56'); - Sets size. item.ammo_cells = 15; - Sets ammo of gun, adjust as needed item.netname = "Thunderbolt"; - Sets name for when you pick it up }Save and go to Step 4. The last Step and your home free....
void() I_Precache = { precache_model ("progs/shotgun.mdl"); precache_model ("progs/g_shot.mdl"); precache_model ("progs/g_nail.mdl"); precache_model ("progs/g_nail2.mdl"); precache_model ("progs/g_rock.mdl"); precache_model ("progs/g_rock2.mdl"); precache_model ("progs/g_light.mdl"); };This precaches the models for the backpack. But it needs to be called.
// player precaches W_Precache (); // get weapon precachesBelow W_Precache(); add I_Precache();.