Backpack Kills
Moderator: InsideQC Admins
5 posts
• Page 1 of 1
Backpack Kills
In void() BackpackTouch =
I added code so that if a backpack contains a certain amount of ammo it will explode.
I want the owner of the backpack to get a frag if a player dies in this manner.
I tried adding:
item.classname = "backpack"; in
void() DropBackpack = and adding:
if (targ.deathtype == "backpack")
{
attacker.frags = attacker.frags + 1;
return;
}
in
void() ClientObituary =
but it didn't work?
I added code so that if a backpack contains a certain amount of ammo it will explode.
I want the owner of the backpack to get a frag if a player dies in this manner.
I tried adding:
item.classname = "backpack"; in
void() DropBackpack = and adding:
if (targ.deathtype == "backpack")
{
attacker.frags = attacker.frags + 1;
return;
}
in
void() ClientObituary =
but it didn't work?
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
-

redrum - Posts: 410
- Joined: Wed Mar 28, 2007 11:35 pm
- Location: Long Island, New York
Assuming you're having the backpack do the damage right, all you should need to do is put something like this:
In void() DropBackpack.
- Code: Select all
item.owner = self;
In void() DropBackpack.
-

Dr. Shadowborg - InsideQC Staff
- Posts: 1110
- Joined: Sat Oct 16, 2004 3:34 pm
Whoops, sorry about that.
Do this instead then:
In DropBackpack()
Then in when you call T_Damage or T_RadiusDamage in your touch function, just set the attacker variable to self.enemy. For example:
Or in the case of T_RadiusDamage
Also, don't forget to put in some kind of delay before it can be picked up if you intend to make it so that the player can drop these while still alive and solid, because if you don't, YOU could blow up instead.
Do this instead then:
- Code: Select all
item.enemy = self;
In DropBackpack()
Then in when you call T_Damage or T_RadiusDamage in your touch function, just set the attacker variable to self.enemy. For example:
- Code: Select all
T_Damage(other, self, self.enemy, damage);
Or in the case of T_RadiusDamage
- Code: Select all
T_RadiusDamage(self, self.enemy, damage, world);
Also, don't forget to put in some kind of delay before it can be picked up if you intend to make it so that the player can drop these while still alive and solid, because if you don't, YOU could blow up instead.
-

Dr. Shadowborg - InsideQC Staff
- Posts: 1110
- Joined: Sat Oct 16, 2004 3:34 pm
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest