How to use !activator in a Point_ServerCommand

So/\/ 0f A M0ther DucK

L1: Registered
Sep 22, 2019
8
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?
 

Da Spud Lord

Occasionally I make maps
aa
Mar 23, 2017
1,339
994
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?
 

So/\/ 0f A M0ther DucK

L1: Registered
Sep 22, 2019
8
0
I think you could adapt the method ABS used for the chairman derby. But it depends on your map and how it works, I think.

I thought there was a way to detect Steam ID via triggers, but I can't seem to remember how or who did that. But if you can find a way to do that you can also name players based on their unique IDs.


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.
 

So/\/ 0f A M0ther DucK

L1: Registered
Sep 22, 2019
8
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:

Avaray

L2: Junior Member
Oct 14, 2011
72
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.
 

So/\/ 0f A M0ther DucK

L1: Registered
Sep 22, 2019
8
0
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.

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!!
 

tyler

aa
Sep 11, 2013
5,100
4,621
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.