Disarming enemy

Need Help? The Day isnt going so well on the Mapping front?
Post Reply
User avatar
Andrax17
Beta Tester
Beta Tester
Posts: 475
Joined: Wed May 05, 2010 7:11 pm
Location: Finland

Disarming enemy

Post by Andrax17 » Fri Feb 11, 2011 11:17 pm

So yea, for my new map, i want players to be able to disarm few metropolice at the beginning.
I planned it so that when player gets near them and press use key, the metropolice would lose hes weapon and the player who pressed it, would get the weapon.

But im not really sure on how to make the metropolice lose hes weapon without making him holster it, nor do i know how to give specific weapon to a player (when the player triggers it)
I dont really know if this is possible...i guess it is.

So if anyone knows how to do this, i would be glad to know.
Image

User avatar
Shana
Lead Developer
Lead Developer
Posts: 3042
Joined: Tue Aug 29, 2006 8:12 pm
Location: Germany
Contact:

Re: Disarming enemy

Post by Shana » Fri Feb 11, 2011 11:22 pm

Weapons of npcs have targetnames too, "<npc's targetname>_weapon".

So you could "kill" the weapon and use game_player_equip to give a weapon to the player.
Image

Axel_m3sh
npc_combine_elite
npc_combine_elite
Posts: 469
Joined: Wed Nov 05, 2008 5:52 am
Location: lolwut L0C4tI0n?

Re: Disarming enemy

Post by Axel_m3sh » Sat Feb 12, 2011 4:28 am

Wait if npc weapons have targetnames, is it possible to then attach something to the weapon? (ie: env_sparks to the muzzle attachment or w/e)

User avatar
Gary
npc_advisor
npc_advisor
Posts: 1160
Joined: Sun Nov 09, 2008 7:21 am
Location: USA, FL
Contact:

Re: Disarming enemy

Post by Gary » Sat Feb 12, 2011 4:34 am

I would assume so... wait... FLASHLIGHTS!!!

Edit:

Image
Have a question related to modding? PM me or message me on Steam(link below)

- [|YouTube|] - [|99 Bolts|] - [|Steam|] - [|Mod DB|] -

Post Reply