How do I make a player only have melee?

Discussion in 'Mapping Questions & Discussion' started by mat_phong 0, Nov 18, 2017.

  1. mat_phong 0

    mat_phong 0 L1: Registered

    Messages:
    24
    Positive Ratings:
    9
    I am planning in making a map but I cannot make players have only melee. How can I make that possible?
    I'd also like to know how to make the player able to pick up weapons around the map and how to spawn the weapon that can be picked up.
     
  2. MegapiemanPHD

    aa MegapiemanPHD Doctorate in Deliciousness

    Messages:
    888
    Positive Ratings:
    438
    use the tf_logic_medieval entity to do melee only. I don't think you can spawn pickupable weapons.
     
    • Thanks Thanks x 1
  3. Werewolf

    aa Werewolf Probably not a real Werewolf

    Messages:
    752
    Positive Ratings:
    212
    Create a big, map wide 'trigger_add_tf_player_condition' brush (can be one big brush or lots of brushes tied to the same entity) and set it to Condition 41 - "Cannot Switch from Melee", and set the duration to -1.

    You then need to have add a named point_clientcommand entity somewhere in the map. (I typically name mine 'ClientCommand', but you can pick your own name.) Go back to the 'trigger_add_tf_player_condition' brush and select it's 'Outputs' tab. Create a new output with this setup:
    Code:
    OnStartTouch | ClientCommand | command | slot3 | 0.00
    Also make sure the 'Clients' flag is enabled in the 'Flags' tab.

    Now whenever someone walks into the brush, it will force them to swap to their melee and prevent them from changing until they leave that zone.

    While you may want the zone for most of your map, don't include the spawn rooms. You'll want to design those so players walk into the melee-zone as they leave spawn. Spawning player directly in the melee-zone can occasionally cause them not the trigger the 'OnStartTouch' and so those players may have their normal weapons.
     
    • Thanks Thanks x 1
    • Agree Agree x 1
    Last edited: Nov 23, 2017
  4. YOYOYO

    YOYOYO L6: Sharp Member

    Messages:
    311
    Positive Ratings:
    148
    this one is easier, but has control than werewovle's
     
  5. henke37

    aa henke37

    Messages:
    1,876
    Positive Ratings:
    440
    Really, what you want to do requires a custom serverside plugin.
     
    • Respectfully Disagree Respectfully Disagree x 1
  6. Werewolf

    aa Werewolf Probably not a real Werewolf

    Messages:
    752
    Positive Ratings:
    212
    Literally 2 methods for it to work without plugins above your post.

    Medieval mode also allows some non-melee weapons and forces the medieval text in chat. And er, "but has control than"? I think you missed an "more" or "less" in there.
     
  7. henke37

    aa henke37

    Messages:
    1,876
    Positive Ratings:
    440
    You guys are focusing on the obvious part of his description. What he actually wants is for players to start without non melee weapons and then find them laying around in the level to be picked up.
     
  8. YOYOYO

    YOYOYO L6: Sharp Member

    Messages:
    311
    Positive Ratings:
    148
    that's what I meant by more control
     
  9. mat_phong 0

    mat_phong 0 L1: Registered

    Messages:
    24
    Positive Ratings:
    9
    I could do it but I don't know any way to make the player have a gun without giving ammo to other guns too. If it's not possible, it's fine, I'll find a way around
    thanks! that is really useful!
    I don't want people to complain about the chat nor do I want my map to be medieval, but can also work as plan B.