Picking Up Weapons on the floor

AD | KoP

L1: Registered
May 7, 2017
2
1
Hello, I want to make a trigger that when trigger will give a weapon to the activator. I thought to go about this by using a point_servercommand and using sm_givew but how would I target the player who triggers it? Or is there another way I should go about this?
 

AD | KoP

L1: Registered
May 7, 2017
2
1
Whatever triggers an entity can be targeted with !activator.

You are probably aware of this, but sm_givew looks like a sourcemod command, so it wont work outside servers with sourcemod.
Yeah it is meant to be for my own server, working on a hunger games type gamemode
 

NoodleCollie

Stoat fiend
aa
Jul 30, 2009
383
335
I dunno whether this will be helpful to your endeavours or not, but if you know how to write plugins I'd try using SourceMod itself for actually giving players weapons. The ability to do so through Hammer/maps is very limited because TF2's item system is so sophisticated, so you can't set up weapon attributes without access to code.

An easier way if you're able to write a plugin would be to place triggers into the map named in such a way that the plugin would be able to find them (for example, a trigger_multiple named "trigger_weapon_xxx"). You can then replace the "xxx" with a TF2 item definition index, and the plugin can hook into when players touch the trigger, find out the trigger name, read the index and give the player that weapon.

If you don't have the ability to write SM plugin code, the above method sounds like it would be good enough if you know that the "sm_givew" command will be available.
 

henke37

aa
Sep 23, 2011
2,075
515
Even better, make up your own entity classes. Then you can write your own fgd and get automatic code completion and property suggestions in hammer.