PDA

View Full Version : Triggers


theY4Kman
02-15-2008, 18:22
To remedy FS#1059 (http://bugs.alliedmods.net/index.php?do=details&task_id=1059&project=5), I created this plugin. It does the same exact thing as commandlist.txt does for Mani Admin Plugin. EDIT: This plugin now offers more advanced features than Mani's commandlist.txt, such as variables and multiple flags.

You create a commandlist.txt (or commandlist.cfg) file in your sourcemod/configs directory and enter the commands.

I have written down all the instructions in the default commandlist.txt, which you can find in the archive files, or look at the copy and paste here:
// Triggers configuration file
// by theY4Kman
//
// So, here's the rundown!
// Commands are entered using the format "<command> <flags> <replacement>"
//
// For example:
// die C kill
//
// When the player types "die" into chat, it will run "kill" on them,
// forcing them to suicide.
//
// Here are the core flags (One needs at least one of these flags to do anything):
// R - Rcon command
// To run this, the user must have Rcon or Root access
// C - Client command
// Run on the player
// Note: only commands with FCVAR_SERVER_CAN_EXECUTE will run
// F - Fake client command
// Runs a networked command as if a player had done it
// S - Fake client say command
// Convenience flag that runs a fake client command with "say" in front of it
// So "hi S Hi!" is the same as "hi F say Hi!"
//
// These next flags are optional:
// v - No variables (Disables the parsing of variables)
// "hi S Hi, I'm %n!" will actually display "Hi, I'm %n!"
// d - Do not display the player's message
// f - Begins a block denoting the flags necessary to run the trigger.
// After the letter, a block beginning with '{' and ending with '}' will contain
// admin flags required for this trigger. For example:
// "kick Rf{c} sm_kick"
// This will let any admin with the kick admin flag execute this trigger.
// If this flag is left out, Triggers will use the admin flags in the cvar "triggers_rcon"
// If one wishes to simply have a command without permissions, use a lone 'f' character.
// e.g., "killme Rf sm_slay %n" is the same as "killme Rf{} sm_slay %n"
//
// Yes, there are variables in this, if only a few.
// The variables are in C-type format, meaning they are a percent sign followed by a single character:
// %i - The IP of the server
// %s - The Steam ID of the player whom triggered the command
// %n - The name of the player whom triggered the command
// %u - The user ID of the player whom triggered the command
// %h - The hostname of the server
// %c - Begins a custom ConVar block.
// This allows one to access ConVars besides "ip" and "hostname"
// To utilize it, use the same syntax as for the `f` flag:
// %c{convar_name}
// To display a literal '%', prepend it with a backslash ('\')
//
// The only comment type available is the single line comment.
// To use it, place "//" IN FRONT OF THE LINE. It will not work anywhere else
//
// Note: For chat messages, the longest a message can be is 127 characters long.
// This includes players' names, hostname, etc!Notes:
'message' can currently only be one word -- I don't see this changing in the future. It's unnecessary most of the time, and would require work. Work. THIS IS AN OUTRAGE!Commands/Cvars:
triggers_version: The version of Triggers
triggers_reload: Clears the commandlist in memory and loads a new one. You can specify a filename to use for loading by calling it by "triggers_reload file"
triggers_rcon: The SourceMod Admin flags that allow someone to run an Rcon command. The person must have at least one of the flags (Flag reference here (http://wiki.alliedmods.net/Adding_Admins_%28SourceMod%29#Levels)). (v2.2.0: This convar can be overridden on a per-trigger basis)Changelog:
1.0.0
* Initial upload
* Basic functionality: Run a command when something is said
1.1.0
* Bug fix: Added 'F' and 'S' flags for fake client commands.
1.2.0
* Bug fix: Fixed the permission issues
2.0.0
* Multiple flags for each command
* Variables
2.1.0
* triggers_rcon convar, allowing for custom access to Rcon triggers.
2.1.1
* Fixed command replacement parsing.
2.2.0
* Per-trigger RCON permissions
2.2.1
* Fixed per-trigger RCON permissions to allow empty permissions.
2.3.0
* Added custom ConVar variable
* Added user ID variableteame06 is dumb :grrr:

Comments? Suggestions? REQUESTS? Tell me!

Extreme_One
02-15-2008, 19:12
:shock:

This will be cool :up:

Thank you.

Quick Query:

If I did this:

!url C say /? urlClient types !url and that would trigger the client to say /? url

Or would I need to do:

!url C say "/? url"or maybe

!url C "say /? url"I just want to make sure I get the syntax correct. ;)

theY4Kman
02-15-2008, 20:09
They all would work.

The plugin parses the config by finding the first space, then selecting all the text behind it for the message. Next, it takes the letter after that first space for the type. Finally, it takes all of the text after the space behind the type character for the command. So...
!url C say /? url
!url C "say /? url"
!url C say "/? url"
...all do the same exact thing.

Extreme_One
02-16-2008, 05:10
Thanks theY4Kman (http://forums.alliedmods.net/member.php?u=28227)

Extreme_One
02-16-2008, 15:44
This has quite limited use :(


!url C say /? url
Extreme_One's Σvîl †ŵiή : !url
FCVAR_SERVER_CAN_EXECUTE prevented server running command: say

theY4Kman
02-16-2008, 16:35
I shall fix it when I get home.

Yeah, it's more of an announcement for anyone else using the plugin :P

Extreme_One
02-16-2008, 17:45
I shall fix it when I get home.

Yeah, it's more of an announcement for anyone else using the plugin :P


yeah the fix will be great :up:

theY4Kman
02-18-2008, 00:11
The new version is up! It still doesn't have multi-word functionality for the message, but I think I'll program that in only when someone needs it. Yeah, screw you; I'm lazy. I want to play TF2.

Extreme_One
02-18-2008, 15:14
Nice one.

Thanks for the update.

Rebell
02-19-2008, 02:40
GOODY ^^

sessus
02-19-2008, 17:37
Yeah that was my original request. Thanks heaps for coding this.

theY4Kman
02-20-2008, 21:38
No problem, man. I figured someone had already written it. When I found out it wasn't, I got off my ass to do it.

Quite a rare occasion, I know.

iha81
03-14-2008, 06:27
I set this in commandlist.cfg which i placed in sourcemod/configs


lo3 R exec lo3.cfg

Didn't work when admin with users say lo3

lo3 i exec lo3

Exec Config Files i Execute config files.
Didn't work as well.

yam90
03-22-2008, 06:43
I have the same problem as iha81, anyone?

Extreme_One
03-22-2008, 07:44
Do your admins have the rcon flag?

yam90
03-22-2008, 16:36
Do your admins have the rcon flag?
yup. I had root access and it still didn't exec

this is my commandlist.cfg file:
!lo3 R exec lo3.cfg
!rr R mp_restartgame 1
!lock R sv_password "anypass"
!specall R sm_spec @all
!kickall R sm_kick @allI have tried cvars with ! and without (example: !cvar). It still didn't work

yam90
03-30-2008, 14:28
Bump.. Still having the problem. also i would like to hide the command that triggers the command from showing in say

like i said !lo3 it does exec lo3 but without showing what i wrote

Extreme_One
03-30-2008, 15:19
Tell you what I'd love to see for this plugin for using the S (say) part is the ability to capture the name of the player that triggered and return it.


Example: let's say %n% was variable that returns the client name

/me S %n%

So I'd type in chat :

/me is tired

And the plugin would return:

Extreme_One is tiredWould be especially effective if proper team colouring was used.

I don't know if this is beyond the scope of this plugin but I hope you'll consider it..

Gently
04-06-2008, 21:07
i got it working after the same problem. coding searches "commandlist.txt" first. so for that config just change the format...then add these admins to the
admins_simple.ini DIRECTLY with at least "m" flag to the list.

should be like this: "STEAM:0:0" "m" //bob's account

in the simple file. I believe its the m flag but i have root so i dunno.i have all my flags listed "abcdefghijklmnopqrstuvwxyz" just to be thorough. i made it work that way after those steps and a triggers_reload....

hope that helps

theY4Kman
04-16-2008, 18:31
Just a heads up that there's a new version: 2.0.0. This version includes multiple flags, variables, and various other bug fixes.

If there's anything wrong or you want a feature added, tell me. I'm much more interested after I've seen all your support. Sorry it took so long to fix everything :P

yam90
04-17-2008, 09:27
Is it possible to add a flag that makes you able to exec an rcon command without the need of rcon access? i think its called ADMFLAG_GENERIC

theY4Kman
04-17-2008, 16:42
Yeah, that's what I wanted to include in this release, but since I hadn't showed any work in a long time, I figured I'd release this. I also meant to tell you that before I released it...Sorry =/

What I can do easily is have a convar that holds the flags you want to be checked when someone runs an Rcon command. For example, you might set triggers_rcon to "abz", and anyone with the 'a', 'b', or 'z' flag will be able to run the command. I think I'll do that now.

yam90
04-18-2008, 01:51
Thanks!

Extreme_One
04-21-2008, 08:39
The %n variable isn't working for me. Everything else works.

Is there a specific minimum Sourcemod version required?

theY4Kman
04-21-2008, 17:13
Ah, thanks, Extreme_One. The problem was in reading the configuration file. The plug-in would automatically shave off a character at the end of the replacement command so that there would be no newline char. However, there isn't always a newline char there...So I patched that up.

New file's there!

Extreme_One
04-23-2008, 18:55
Hmm I still get nothing with %n in my config :/

theY4Kman
04-23-2008, 18:58
Hm...I don't know what could possibly causing that now. Would you mind posting your config file?

Extreme_One
04-24-2008, 15:47
Hm...I don't know what could possibly causing that now. Would you mind posting your config file?

commandlist.cfg

!url S /? url
!evil S /? evil
!english S /? english
!teamspeak S /? ts
!capgravel S /? capgravel
!teleport S /? teleport
!slot S /? slot
!spam S /? spam
!twin S /? twin
!name S /? name
!me S /? me
!list S /kbase_list
!F10 S /? F10
!f10 S /? F10
!recruit S /? recruit
!add S /? add
!resident S /? resident
!fps S /? fps
!setup S /? setup
maplist S /maplist
listmaps S /maplist
!song S /irc !!!song
!dj S /irc !!!dj
!!radio S /irc !!!radio
?radio S /irc !!!radio
!listeners S /irc !!!listeners
gay S I'm %n and I'm gay!
g4y S I'm %n and I'm gay!
ghey S I'm %n and I'm gay!
ghay S I'm %n and I'm gay!
gh4y S I'm %n and I'm gay!
g-a-y S I'm %n and I'm gay!
g-4-y S I'm %n and I'm gay!
!spray S /tracespray
/spray S /tracespray
f10 S I'm a tool and I think an admin should kick me!
F10 S I'm a tool and I think an admin should kick me!
f-10 S I'm a tool and I think an admin should kick me!
F-10 S I'm a tool and I think an admin should kick me!
f_10 S I'm a tool and I think an admin should kick me!
F_10 S I'm a tool and I think an admin should kick me!
!auth S /irc !!auth
!choon S /irc !!!choon
!poon S /irc !!!poon
!djrocks S /irc !!!djrocks
!djsucks S /irc !!!djsucks
!rate5 S /irc !!rate 5
!rate4 S /irc !!rate 4
!rate3 S /irc !!rate 3
!rate2 S /irc !!rate 2
!rate1 S /irc !!rate 1
!killer C sm_ki_toggle
!RADIO S !radio
!ADMIN S !admin
/me S *%n
hi S Hi, I'm %n!All the commands work perfectly apart from those which attempt to make use of the %n variable

flubber
07-11-2008, 11:54
Seems making someone saying something doesn't work?

aide S !helpmenu work
gay S I'm %n and I'm gay! doesn't work

theY4Kman
07-11-2008, 16:07
The problems you're having are not with the Triggers plugin, they're with the server. Automatic flood protection is on. When the player says "gay", and then 1 frame later says something else, the server discards the second message. To stop that, use the disable player message flag ("d"):
gay Sd I'm %n and I'm gay!
Instead of the server just displaying the message "gay", it will only display the message "I'm <player> and I'm gay!"

flubber
07-11-2008, 20:11
Excellent thx.

Extreme_One
07-12-2008, 07:15
...
gay Sd I'm %n and I'm gay!Instead of the server just displaying the message "gay", it will only display the message "I'm <player> and I'm gay!"

Cheers theY4Kman; it works :)

Darkfoxx
07-20-2008, 18:53
Question:
Can I have a trigger such as "donate" that when typed into chat, opens a URL in the in-game browser?

theY4Kman
07-20-2008, 19:59
There are other plugins for that. This just maps chat triggers with console commands.

Darkfoxx
07-20-2008, 22:53
There are other plugins for that. This just maps chat triggers with console commands.
Link please?

flubber
07-21-2008, 01:28
Link please?
Hop là :
http://forums.alliedmods.net/showthread.php?t=58668

Crap
09-09-2008, 02:51
Not sure if this is possible with this plugin, if not, consider this a feature request :)

I'd like to setup triggers that allow anyone to issue certain server commands.

For example

killme R sm_slay %n

But I want this to be usable by anyone, not just admins with the rcon flag or admins, but any player on the server. I run a map test server and new custom maps players often get stuck or whatever and having them be able to say "killme" in chat to suicide is easier than explaining how to enable and use the console 1500 times :)

theY4Kman
09-09-2008, 06:07
It's possible now, just not on a per-trigger basis. To allow normal players to run rcon commands, set triggers_rcon to "". I haven't looked at the code for this in a long time, though, so even I could be wrong.

When I get home this evening, I'll take a look at it.

Crap
09-09-2008, 15:47
It's possible now, just not on a per-trigger basis. To allow normal players to run rcon commands, set triggers_rcon to "". I haven't looked at the code for this in a long time, though, so even I could be wrong.

When I get home this evening, I'll take a look at it.

Will test it out myself as well. Being able to set things on a per trigger basis would be great, but it's not absolutely necessary for me. I don't generally set up triggers for admin commands, just for stuff I want general players to be able to use.

Thanks :up:

Crap
09-14-2008, 04:07
It's quite possible I am screwing something up (again) but setting the required admin flag to "" seems to completely disable rcon triggers.

theY4Kman
09-15-2008, 01:19
Alright, it seems I should write in per-trigger admin flags. For tomorrow!
*writes it down*

Crap
09-15-2008, 02:25
Alright, it seems I should write in per-trigger admin flags. For tomorrow!
*writes it down*

I'll make you my new honorary best friend once it's done. :wink:

Seriously, thanks. The plugin is otherwise perfect.

theY4Kman
09-15-2008, 22:49
Aw, crap, I forgot to write it down! I taped it on my screen now, though.

theY4Kman
09-16-2008, 22:20
Alright, I've written in per-trigger RCON permissions. You can pay me my money now.

To utilize the new functionality, use the 'f' Trigger flag. Then, put whatever admin flags between a '{' and an ending '}' character. For example:"ban Rf{b} sm_ban"This will only allow players with the ban flag to execute the command. If you don't supply the "f{}" flag with the trigger, it will use the triggers_rcon convar to determine who can run the trigger.

Crap
09-17-2008, 02:20
Alright, I've written in per-trigger RCON permissions. You can pay me my money now.

To utilize the new functionality, use the 'f' Trigger flag. Then, put whatever admin flags between a '{' and an ending '}' character. For example:"ban Rf{b} sm_ban"This will only allow players with the ban flag to execute the command. If you don't supply the "f{}" flag with the trigger, it will use the triggers_rcon convar to determine who can run the trigger.

Sorry for being dense, so will this now allow us to make rcon triggers that can be used by anyone? E.g. Killme in chat to have the console slay one's self?

theY4Kman
09-17-2008, 19:09
I made a mistake on 2.2.0, and I didn't include that functionality :P. However, I wrote a quick fix (which took me 45 minutes -- always use a syntax highlighting editor. Always.) for it, and I've uploaded it to the first page.

Crap
09-18-2008, 01:05
I made a mistake on 2.2.0, and I didn't include that functionality :P. However, I wrote a quick fix (which took me 45 minutes -- always use a syntax highlighting editor. Always.) for it, and I've uploaded it to the first page.

Thank you! You are awesome! Now my players can suicide again without me having to teach half of them what the console is and how to enable it =)

soupyblister
09-19-2008, 13:37
Need some help, I placed the commandlist.txt in my sourcemod/configs folder. and added these lines to get a radio, and its not working

"!radio"http://www.sourcetunes.com/players/server_player/radio.php?id=tf2
"!off"http://www.sourcetunes.com/players/server_player/off.php?id=default

Am I missing a step or something?

Ravager01
09-19-2008, 16:17
Need some help, I placed the commandlist.txt in my sourcemod/configs folder. and added these lines to get a radio, and its not working

"!radio"http://www.sourcetunes.com/players/server_player/radio.php?id=tf2
"!off"http://www.sourcetunes.com/players/server_player/off.php?id=default

Am I missing a step or something?

There's another plugin for that.

theY4Kman
09-19-2008, 23:21
Hey, guys. I got bored, so I updated Triggers again :P
I added two new variables: a User ID variable (%u), and a custom ConVar variable (%c{my_convar_name}). I'm still awaiting my payment!

Crap
09-20-2008, 03:57
Hey, guys. I got bored, so I updated Triggers again :P
I added two new variables: a User ID variable (%u), and a custom ConVar variable (%c{my_convar_name}). I'm still awaiting my payment!

Will my undying gratitude be sufficient? :avast:

I've already given karma enough times that it won't let me do it anymore :oops:

theY4Kman
09-20-2008, 11:25
Hey, I joined this open source movement for one thing, and one thing only: to strike it RICH!

Crap
09-22-2008, 03:55
Hey, I joined this open source movement for one thing, and one thing only: to strike it RICH!

Best of luck with that! If it works out for you, buy me a new pc please. :mrgreen:

ayuki
09-26-2008, 07:06
it's possible to post exemple with command sm_ban etc

theY4Kman
09-26-2008, 23:34
Every console command registered by SourceMod already comes with a chat trigger. If the command is prefixed by "sm_", that is taken off, and then the suffix is used as the command. For example, "sm_ban" could be used in chat by typing "!ban that_player". If one uses a forward slash ('/') instead of the exclamation mark ('!'), the chat tirgger does not show up in chat, just like the "d" flag in Triggers.

Any other command that is not prepended with "sm_" creates a chat trigger the same name as the command. So the command "triggers_reload" could be used in chat by typing "!triggers_reload".

This plug-in is useful when one needs to format a command, or create chat triggers for commands not registered by SourceMod. I hear it's used as a word filter, too :P

Ravager01
09-27-2008, 12:23
I use it to autoban racists, although it's only effective on single word lines. :P
You've also seen what I can do with it, theY4Kman. XD

NEED WILDCARDS >_<

Crap
09-27-2008, 13:53
I use it to autoban racists, although it's only effective on single word lines. :P
You've also seen what I can do with it, theY4Kman. XD

NEED WILDCARDS >_<

I set mine up to slay/explode/timebomb/csay messages about the player when a player uses certain words and phrases :wink:

haderlump
10-16-2008, 15:29
do we install the .smx AND the .sp ?
sorry! and thanks!!

yea, im off mani!,
=H

theY4Kman
10-16-2008, 15:39
do we install the .smx AND the .sp ?
sorry! and thanks!!

yea, im off mani!,
=H
The .smx is required, but the .sp is completely optional -- it will not affect the plug-in whatsoever; it is the source code.

If you're uneasy about it, use one of the archives :)

haderlump
10-16-2008, 17:33
excellent. i wont use it if its superfluous. its for someone
who wants to mod it somewhat. now, i will stop installing
all of them - haha

and is there a way to do 2 things for one action, like:

ni##er S dont say that here
AND
Rf sm_silence %n

btw, using "Rf" means that this
non-admin person can run the
admin commands (eg- sm_silence)
on themselves? am i reading the
instruction on that correctly?

=H

PS- i dont think i need an archive, but i dont know what
that is either... this plugin is so flexible, i love all the
fun uses ppl are finding for it. the guy who replaced
"mccain" with "senile old guy" is the best!! LOLs

theY4Kman
10-16-2008, 17:38
Currently, there's no way to run different commands for different flags. However, one can run multiple commands. For example, this line would print "Don't say that.", silence the player, and stop their message from being displayed:
term Rdf sm_silence "%u"; sm_say "Don't say that, %n"

haderlump
10-16-2008, 20:53
cool, that works!

but i think im doing others in the wrong fashion:

stats Cd say hlx
returns server prevented command 'say' ...

/stats Sd hlx
returns with "hlx" being said but you see it,
rather than (it being hidden and) opening the stats

leV
04-11-2009, 18:02
First, I would like to apologise if this question has been answered already.

How could I write a line that would make the server use sm_say (like Tsunami's advertisements) whenever a player said a certain word in a sentance, both displaying the clients message and then afterwords the servers message?

So if I were to say: Damn hackers!
The server would say: Report hackers at www.url.com!

Hovercat
04-20-2009, 06:27
I have stuff like !killme if someone wants to die, !me goes like Hi my name is %n and my steam ID is %s. But... None of them work.


Help?


It never said that the plugin had failed in sm plugins list.

theY4Kman
04-20-2009, 07:28
Would you post your configuration?

leV
05-10-2009, 00:23
First, I would like to apologise if this question has been answered already.

How could I write a line that would make the server use sm_say (like Tsunami's advertisements) whenever a player said a certain word in a sentance, both displaying the clients message and then afterwords the servers message?

So if I were to say: Damn hackers!
The server would say: Report hackers at www.url.com (http://www.url.com)!

theY4Kman
05-10-2009, 13:45
This plug-in reacts to the first word in a message, so that's impossible to do. However, I could write a plug-in for you, if you'd like.

ant_coe_
08-12-2009, 00:22
This is the closest plugin that does exactly what i want, i just need the ability to include wildcards in the trigger.

Basically i'm after disabling the the in-game rank system, the only command i have yet to disable is the 'top' command, as a person can type 'top' or 'topsgdh' and still get the same top result from mani plugin.

So far, i have managed to disable just the 'top' command, by using

'top d nothing'

but when a user types anything after the word 'top' the command is not blocked.

I do understand that the mani ranking system can be disabled, but thats not what im after, im just after stopping users from seeing any form of rank in game, the remainder of the commands (rank, statsme, mystats) can be disabled

Any help/hints appreciated :)

Tony

theY4Kman
08-12-2009, 02:07
This is the closest plugin that does exactly what i want, i just need the ability to include wildcards in the trigger.

Basically i'm after disabling the the in-game rank system, the only command i have yet to disable is the 'top' command, as a person can type 'top' or 'topsgdh' and still get the same top result from mani plugin.

So far, i have managed to disable just the 'top' command, by using

'top d nothing'

but when a user types anything after the word 'top' the command is not blocked.

I do understand that the mani ranking system can be disabled, but thats not what im after, im just after stopping users from seeing any form of rank in game, the remainder of the commands (rank, statsme, mystats) can be disabled

Any help/hints appreciated :)

Tony

Unfortunately, Triggers does not include this functionality. It's something I plan to do in the future, but if you'd really like to see something like that get done soon, you'll have to write a plug-in for it. If you don't know how to write plug-ins, there are many tutorials and much documentation available; plus, we're always available to help on IRC. If programming is definitely not your fancy, create a thread in the requests forum, and someone will definitely write something for ya (or I will if no one else does).

My apologies,
Zach "theY4Kman" Kanzler

Viper_Vicki
12-08-2009, 07:25
Is there a way to use this plugin to make players say predefined messages if they are saying inappropiate things in the server. For example, beetles mod has a command called happy, if you turn it on a player while in game, every time he text chats the predefined messages that one has set up becomes his chat everytime he types, until it is turned off.

Thanks

theY4Kman
12-08-2009, 22:18
No, you'll need a different or custom plug-in for that.

ayuki
02-04-2010, 04:14
is possible to write


!war R /exec war.cfg
or

!war R exec war.cfg

theY4Kman
02-04-2010, 18:02
Yes, it is.

damntry
03-06-2010, 09:49
I can´t get it to work. The plugin reports no errors and seems to work fine, but looks like it doesnt catch any trigger at all.

Attached is my commandlist, located in the addons\sourcemod\configs folder

The only command that works is !help, which triggers !helpmenu correctly, and incidentaly !help is the only command that already has a trigger assigned by hlstatsx I think.

theY4Kman
03-06-2010, 13:13
I can´t get it to work. The plugin reports no errors and seems to work fine, but looks like it doesnt catch any trigger at all. ...

Is Triggers in the `sm plugins list`?

damntry
03-06-2010, 17:59
Is Triggers in the `sm plugins list`?

Yes, and "sm plugins info..." shows that it loaded just fine.

theY4Kman
03-06-2010, 22:32
Would you mind pasting the output of `sm plugins info`?

damntry
03-07-2010, 15:33
Filename: Triggers.smx
Title: Triggers (Advanced commandlist.txt funcionality)
Author: theY4Kman
Version: 2.3.0
URL: http:\\blablabla
Status: running
Reloads: map change if updated
Timestamp:

theY4Kman
03-07-2010, 17:37
Alright, can you tell me what mod this is for, your version of SourceMod (including revision number if you're using the developer branch -- 1.4+), and the exact output of `sm plugins info triggers`?

damntry
03-09-2010, 05:29
Sorry for not being able to reply before.

It´s for Left4Dead 2 version 2.0.1.1, using sourcemod 1.4, Windows branch 2927.

The info output is what I pasted in my last post, did you meant something else?

xzibiz
04-18-2010, 09:25
i'm have beed looking for something like this for a while.
Runing CSPromod på cs:s server.

And i'm not getting this to work like i wil.

When a normal user types !url, i want the server to "say www.exempel.com"
what do i need to do in commands.txt file to get this working ?

theY4Kman
04-18-2010, 16:56
!url Rf sm_say www.exempel.com

Sreaper
04-18-2010, 17:16
Hey, im having some trouble getting this to work properly. :|

Basically im trying to get the command to not show in the chat to anyone when it's typed.

explode RSd /sm_explode %n

What should I change to make it so when people type, explode, the word explode won't show up in the public chat/team chat when someone types it?

theY4Kman
04-18-2010, 17:21
The lowercase 'd' flag is all you should need. Also, the slash command in chat is just a shortcut for running the command. So instead of saying "/sm_explode" in chat, you can just run "sm_explode", which would shorten your command line to:
explode Rd sm_explode %n

I sense that you want everyone to be able to use that command. In that case, you need to set the required RCON flags for the Trigger to be none. You do that with a lowercase 'f':
explode Rfd sm_explode %n
That will most likely solve your problem. Before, if the user didn't have the required RCON flags as set in triggers_rcon, "explode" would stay in chat, and no command would be executed.

Sreaper
04-18-2010, 17:37
Hey, thanks for the reply! Though the first quote, and the second quote you posted, it isn't quite working as nothing is happening now when people type explode.

Im trying to make it so that when anyone in the server types the word explode, that message will not be shown to anyone but the console will still explode that player. I have rcon and im still not able to get this to work. Also im trying this on TF2 if that means anything.

theY4Kman
04-18-2010, 17:56
If you change the "sm_explode" to "sm_say", does it display the user's name over chat?

Sreaper
04-18-2010, 18:14
If you change the "sm_explode" to "sm_say", does it display the user's name over chat?

Alright modifying your second quote you recommended I changed it to this

explode Rfd sm_say %n

What this does now, when someone types explode in chat,

(ALL) Console: Playernamehere

:\

It's executing a fake console message stating the players name who executed the command.

theY4Kman
04-18-2010, 18:22
I think the problem, then, is that you don't have the command "sm_explode". It's available in the FuncommandsX (http://forums.alliedmods.net/showthread.php?t=75520) plug-in. Once that's installed, the "sm_explode" trigger should work just fine.

Sreaper
04-18-2010, 18:29
I think the problem, then, is that you don't have the command "sm_explode". It's available in the FuncommandsX (http://forums.alliedmods.net/showthread.php?t=75520) plug-in. Once that's installed, the "sm_explode" trigger should work just fine.

Oh but I do have the command sm_explode, I even have to of them that work quite well. I changed the sm_command to sm_slay and it still is showing up in the public chat. You have TF2 right? I should also mention that changing the commandslist.txt requires a server restart for the changes to take effect, not just a map change. Still no luck. :(

People still see people typing explode in chat. Though the sm_slay flag slays them fine.

theY4Kman
04-18-2010, 18:34
And that sm_explode command works if you call it from RCON? Also, if you're going to perform a command on someone, it's best to use their Steam or user ID:
explode Rfd sm_explode %s
By the way, the concommand triggers_reload refreshes all triggers from commandlist.txt, so you don't have to restart the server.

Sreaper
04-18-2010, 19:07
Hey thanks for all of your help with the plugin, I messed around with some settings. I finally got it to work.

fire Rdf{*} sm_ignite %nThough, if change the %n to an %s for the steam id nothing happens. It may be a bug or not. But if works if I just use the n. Thankyou. :)

theY4Kman
04-18-2010, 19:16
I'm glad you got it working. Sorry I couldn't figure it out for ya ;)

Sreaper
05-14-2010, 18:55
Hey, need some quick help again,


basically this is what im using. For some reason this only works for admins. The script itself has the convars set to ADMNFLAG_ROOT if that means anything

stale Rf{*} sm_stale %n 86400

Yet, if I manually entered that in console it would force it on everyone, am I missing something here?

It works perfect for admins but when players type it, nothing happens? I've refreshed the plugin several times. ._.

Hovercat
07-21-2010, 20:42
Would there be a way to add an argument for your triggers plugin? For example, if I did:

!say Hi!

It would run the trigger

!say %a C say %a

Where %a = argument (Hi!)

I'm trying to set up a server using SourceOP and to make an easy spawning. And if I do:

!%a C e_spawnprop %a

That would be so much easier than writing all the triggers for all the spawns. I hope this can be added!

theY4Kman
07-22-2010, 02:38
Everything after the trigger is automatically appended to the command. For example, take the trigger line"!say F say"When a player types in "!say Hello!", the command "say Hello!" will be written.

As for including the arguments inside the trigger (your example was "!%a C e_spawnprop %a"), I can't think of any use cases that require it. If you have some reasonable examples, that might sway my opinion to writing it into the plug-in. It's just too complicated/time-consuming for me to implement without any foreseeable gain.

Hope this helps!

mrbday
08-05-2010, 10:58
I am trying to accomplish something like the following: I do have the plugin that uses these commands, can you tell me if this looks right or how I need to make it correct

!m4a1 Cf{a} "sm_cash @me +16000; sm_armour @me 100; sm_give @me weapon_m4a1; sm_give @me weapon_deagle; sm_give @me weapon_hegrenade; sm_give @me weapon_smokegrenade; sm_give @me weapon_flashbang; sm_give @me weapon_flashbang"

theY4Kman
08-05-2010, 23:43
There is a very, very limited set of commands that can be run with the 'C' flag. For almost every command you want a user to run, use the 'F' flag instead. So,
!m4a1 Ff{a} "sm_cash @me +16000; sm_armour @me 100; sm_give @me weapon_m4a1; sm_give @me weapon_deagle; sm_give @me weapon_hegrenade; sm_give @me weapon_smokegrenade; sm_give @me weapon_flashbang; sm_give @me weapon_flashbang"

mrbday
08-06-2010, 06:53
I changed this to use only commands found in the super commands that is inclusive with sourcemod now.

!m4a1 Ff{a} "sm_cash @me +16000; sm_armour @me 100; sm_weapon @me weapon_m4a1; sm_weapon @me weapon_deagle; sm_weapon @me weapon_hegrenade; sm_weapon @me weapon_smokegrenade; sm_weapon @me weapon_flashbang; sm_weapon @me weapon_flashbang"

However, I don't believe that super commands recognizes "@me". Is there one of the other variables that I could use for this ? I apologize for these probably simplistic questions, I am not very versed in coding.


This is for the admins to be able to type in and use in game. I have changed no other file nor used any other command anywhere else. Should this work as it is now ?

theY4Kman
08-06-2010, 10:22
Instead of @me, you could use the Triggers variable for userid: %u

That should work for ya. I'm not too sure of the quotes, so if it doesn'work, try removing them. Also, the 'a' admin flag is for reserved slot access. If you wanted any admin to be able to use the command, use the 'b' flag instead.

mrbday
08-06-2010, 11:05
Dumb question, what is the difference between %u and %s. Is the %u there name in game. If so, I need to use the %s. Super commands looks for a steam id target to be in this format "#Steamid" with the quotes included. Would using this work "#%s"

theY4Kman
08-06-2010, 11:19
All of this information is available in the first post and the commandlist.txt.

%u is the player's unique user ID. %s is the player's Steam ID. %n is the player's name. Yes, using #%s would work.

Hovercat
10-03-2010, 17:56
My triggers don't work with the HL2:DM update. Will there be a release for the HL2:DM update?

theY4Kman
10-04-2010, 13:49
Would you mind posting or PMing me your triggers so that I can test them on HL2DM? Are all of them not working, or just some?

br5dy
02-02-2011, 14:00
Hello!

I'm having a problem with this plugin (I think??). Whenever a player issues a command it kills the server (shuts it down).

Here is my commandlist.txt:


!ammo_on Rf sm_fia %n 1;sm_say Unlimited ammo has been turned on for %n
!ammo_off Rf sm_fia %n 0;sm_say Unlimited ammo has been turned off for %n
!crits_on Rf sm_crits %n 1;sm_say All crits has been turned on for %n
!crits_off Rf sm_crits %n 0;sm_say All crits has been turned off for %n
!god_on Rf sm_god %n 1;sm_say God mode has been turned on for %n
!god_off Rf sm_god %n 0;sm_say God mode has been turned off for %n
!uber Rf sm_setuber %n 100;sm_say Full ubercharge was given to %n
!speed Rf sm_setspeed %n 400;sm_say Fast speed was given to %n
!commands Rf sm_say Commands: votekick, thetime, motd, rtd, !ammo_on, !ammo_off, !crits_on, !crits_off;sm_say Commands: !god_on, !god_off, !uber, !speed


When I call the sm commands manually via console no freezing occurs. Any ideas?

Thanks,
[BR5DY]

br5dy
02-02-2011, 22:59
Also, I tried using %s instead of %n, and also I tried taking out the ";" and everything after it.

theY4Kman
02-07-2011, 08:13
Sorry for the very latent response.

What mod are you running?

br5dy
02-07-2011, 10:24
TF2

theY4Kman
02-08-2011, 01:00
I'm sorry, I've been very busy lately, but I should have some time to test it out soon. Though, I've got some preliminary questions that might help:
1. Have you tried unloading all plug-ins but Triggers and seeing if it still crashes the server?
2. If it doesn't crash the server, manually load in your plug-ins one at a time and test to see if it crashes the server.

The plug-in hasn't been updated in a long time, and it's very possible an engine update killed it, and from your description it sounds most likely, but I just wanted to get those possibilities out of the way.

br5dy
02-08-2011, 13:39
Thanks for your reply. Yes, I've tried unloading the plugins with no success. The server only crashes after a trigger command is issued, despite what it's calling for. All of the other plugins work fine when called via console by an admin.

Thank you very much!

br5dy
02-11-2011, 09:56
Any ideas?

theY4Kman
02-11-2011, 13:00
I can't think of anything, and I don't want to let on that I have the time to support this plug-in anymore. I'll try to find someone to pass the torch onto, but I doubt anyone will want to take it. One day I might find some time to troubleshoot your issue, but that could be tomorrow or months from now.

Warstories
08-19-2012, 21:40
Seems like %n doesn't work if the player has spaces in their name, how do I fix this?

asherkin
08-19-2012, 21:45
Hello!

I'm having a problem with this plugin (I think??). Whenever a player issues a command it kills the server (shuts it down).

Here is my commandlist.txt:


!ammo_on Rf sm_fia %n 1;sm_say Unlimited ammo has been turned on for %n
!ammo_off Rf sm_fia %n 0;sm_say Unlimited ammo has been turned off for %n
!crits_on Rf sm_crits %n 1;sm_say All crits has been turned on for %n
!crits_off Rf sm_crits %n 0;sm_say All crits has been turned off for %n
!god_on Rf sm_god %n 1;sm_say God mode has been turned on for %n
!god_off Rf sm_god %n 0;sm_say God mode has been turned off for %n
!uber Rf sm_setuber %n 100;sm_say Full ubercharge was given to %n
!speed Rf sm_setspeed %n 400;sm_say Fast speed was given to %n
!commands Rf sm_say Commands: votekick, thetime, motd, rtd, !ammo_on, !ammo_off, !crits_on, !crits_off;sm_say Commands: !god_on, !god_off, !uber, !speed


When I call the sm commands manually via console no freezing occurs. Any ideas?

Thanks,
[BR5DY]

Executing commands by name is insanely dangerous, use userids.

theY4Kman
08-19-2012, 21:46
Seems like %n doesn't work if the player has spaces in their name, how do I fix this?

Doesn't work when you use it to identify them in commands? As in:
killme Rf sm_slay %n

If that's the case, use their Steam ID or user ID, instead. Respectively:
killme Rf sm_slay "#%s" // Steam ID
killme Rf sm_slay #%u // User ID

See the Admin Commands wiki page (http://wiki.alliedmods.net/Admin_Commands_(SourceMod)) for more info on the ways you can identify players.

However, if %n won't print the user's name at all if they have a space in it, I have some work to do :P

Warstories
08-19-2012, 21:57
Doesn't work when you use it to identify them in commands? As in:
killme Rf sm_slay %n

If that's the case, use their Steam ID or user ID, instead. Respectively:
killme Rf sm_slay "#%s" // Steam ID
killme Rf sm_slay #%u // User ID

See the Admin Commands wiki page (http://wiki.alliedmods.net/Admin_Commands_(SourceMod)) for more info on the ways you can identify players.

However, if %n won't print the user's name at all if they have a space in it, I have some work to do :P

When it does userid it chooses a different person on the server then themselves like I typed slay and slayed a different person other then myself, and steamid doesn't work either because they have a space in their name, it works for sm_slay though even with a space, but when I try using it with the Randomizer reroll command, if they have a space in their name it won't work at all, but it does work if they don't have a space, hope that makes some sense

DoPe^
01-11-2013, 17:02
would it be possible to do, so lets say a client types topx (where x is a number) then it would run sm_top x (where x is that number) ? like this
i type top23 in the chat, it then runs sm_top 23

top C sm_top

because atm as it is, you can only type top and nothing more.

theY4Kman
01-11-2013, 17:05
would it be possible to do, so lets say a client types topx (where x is a number) then it would run sm_top x (where x is that number) ? like this
i type top23 in the chat, it then runs sm_top 23

top C sm_top

because atm as it is, you can only type top and nothing more.

With "top C sm_top", you should be able to type "top 23" in chat and have it run "sm_top 23". However, the space is necessary, unless you create lines for "top1" ... "topX"

DoPe^
01-11-2013, 18:37
With "top C sm_top", you should be able to type "top 23" in chat and have it run "sm_top 23". However, the space is necessary, unless you create lines for "top1" ... "topX"

hmm i just tried and it didnt work :(

tried top 20, but nothing happend and if i run sm_top 20 in console the menu pops up.

loranger
02-16-2013, 02:34
Can someone tell me if this plugin is working on snapshot 3785?

nope.avi
05-10-2013, 22:57
Hi there, I'm having some difficulties with the plugin.

How can I make it so that typing !climb in chat would run "sm_givew @me 2171", for all players?

I have tried

!climb Rfd sm_givew %n 2171
but it didn't work.

Rads
05-11-2013, 09:49
Yo what's with this bad Picture of yours .? fix it will you way to big

matchaboy
07-08-2013, 09:20
This plugin doesn't work anymore, I think, or is either I typed it wrongly. Anyone also has the same problem as me?

zigvt85
10-31-2014, 21:02
Nevermind it works just not sure why my plugins are not working when I try to trigger them I will get it eventually.

Stylee32
02-22-2015, 03:07
Nevermind, it appears to be a fault of sourcemod