Picking Up Weapons on the floor

Discussion in 'Mapping Questions & Discussion' started by AD | KoP, May 7, 2017.

  1. AD | KoP

    AD | KoP L1: Registered

    Messages:
    2
    Positive Ratings:
    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?
     
  2. Faux Rhinoceros

    aa Faux Rhinoceros Also known as Dr. Element

    Messages:
    1,477
    Positive Ratings:
    1,367
    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.
     
  3. AD | KoP

    AD | KoP L1: Registered

    Messages:
    2
    Positive Ratings:
    1
    Yeah it is meant to be for my own server, working on a hunger games type gamemode
     
    • Agree Agree x 1
  4. x6herbius

    aa x6herbius

    Messages:
    377
    Positive Ratings:
    271
    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.
     
  5. henke37

    aa henke37

    Messages:
    1,909
    Positive Ratings:
    446
    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.