How to use !activator in a Point_ServerCommand

Discussion in 'Mapping Questions & Discussion' started by So/\/ 0f A M0ther DucK, Sep 22, 2019.

  1. So/\/ 0f A M0ther DucK

    So/\/ 0f A M0ther DucK L1: Registered

    Messages:
    8
    Positive Ratings:
    0
    I want it in my map so when a player walks over a trigger box I can use the command sm_givew "playername" "weapon". Is there a way to pass the player name in this query?
     
  2. Da Spud Lord

    aa Da Spud Lord L0: Crappy Member

    Messages:
    1,119
    Positive Ratings:
    763
    As far as I know, there is no way to get and output a player's username using map logic. Although I doubt it will work, have you tried using !activator in place of playername?
     
  3. tyler

    aa tyler

    Messages:
    5,097
    Positive Ratings:
    4,591
    • Like Like x 1
  4. So/\/ 0f A M0ther DucK

    So/\/ 0f A M0ther DucK L1: Registered

    Messages:
    8
    Positive Ratings:
    0
    Yeaa it jus says !activator haha
     
  5. So/\/ 0f A M0ther DucK

    So/\/ 0f A M0ther DucK L1: Registered

    Messages:
    8
    Positive Ratings:
    0

    Ok ill try and look through and see how he did it. I did manage to write a small plugin that hooks itself to the trigger and I get their steamID that way but im don't know much about sourcemod coding. And I think i would need to make a custom plugin file for every map.
     
  6. Avaray

    Avaray L2: Junior Member

    Messages:
    75
    Positive Ratings:
    4
  7. So/\/ 0f A M0ther DucK

    So/\/ 0f A M0ther DucK L1: Registered

    Messages:
    8
    Positive Ratings:
    0
    That seeeeems like its what I need? but im not very experienced with hammer :p umm would it be possible to post a screen shot of how the properties are setup?

    EDIT: again im not sure cause I don't know much about hammer but I actually don't think this is what I need I want to run a command automatically using the activators name. What you were doing is detecting when a player used a command? again im not sure :| but thank you for the help!
     
    Last edited: Sep 24, 2019
  8. Avaray

    Avaray L2: Junior Member

    Messages:
    75
    Positive Ratings:
    4
    I read this topic again and now I know my link won't help you. Sorry for misleading.

    You need to use SM, write your own plugin.
    You will need just one plugin, you don't need different plugin for each map.
    Use always the same targetnames for your triggers, lets say wpn1, wpn2, wpn3.
    In plugin listen for trigger activations, where targetname starts from wpn*.
    Plugin will check who is activating it, and will give proper weapon for him (because you will create list of triggers, ex: wpn1 = pistol, wpn2 = rocketlauncher, etc).
    You can ask people on AlliedModders for creating that plugin for you.

    That's my first idea.
     
    • Thanks Thanks x 1
  9. So/\/ 0f A M0ther DucK

    So/\/ 0f A M0ther DucK L1: Registered

    Messages:
    8
    Positive Ratings:
    0
    Hmmmmmmm yea your right. I kind of have a working plugin but I think mine would crash If I didn't have all the triggers that im searching for present in the level. But I can just put any triggers I don't want somewhere where players can't touch em. Thanks for all the help!!
     
  10. So/\/ 0f A M0ther DucK

    So/\/ 0f A M0ther DucK L1: Registered

    Messages:
    8
    Positive Ratings:
    0
    The map download links lead to a 404 error :(
     
  11. tyler

    aa tyler

    Messages:
    5,097
    Positive Ratings:
    4,591
    All the important info for that is in the post itself anyway, where the logic is laid out and explained, but I do think that you need to use a plugin for this anyway.