this plugin lets you attach a "flag" to a steam account, and you can:
- warn admins when a player who has been banned before has entered
- execute commands on players when they connect, are putinserver, or every single round (need an example? amx_slay...)
- execute commands normally used by amx_exec (i.e. name "Player")
what are flags?
- a flag attaches certain commands set to execute at a certain time on a steam account; the commands are called "flag commands"
- there are two files created in your configs directory: flagging.ini (which isn't created unless you add a flag in-game) and flagcmds.ini - this stores the stuff you use or whatever
- you can make 150 flags and like 64 commands or something, if you want more change the defines in the plugin
i used PM's cvar rules
plugin for inspiration and ideas, and he also answered some questions i had through pm. thanks PM!
plugin idea: http://forums.alliedmods.net/showthread.php?t=10170
in the plugin
amx_flagging - toggles the plugin
amx_autoflagging - toggles whether or not a flag is added for tempbans
(if you ban someone and it's not permanent, they automatically get a flag added with the command "bandefault")
- brings up the general flag menu (for adding, deleting, or editing a flag)
amx_addflagsmenu [name | steam id | #userid]
- brings up the menu for adding a flag to a player in the server
- brings up the menu for deleting a flag
amx_editflagsmenu [name | steam id | #userid]
- brings up the menu for editing a flag's commands
- displays the flags in the server in the console
amx_flags "list" [flag # | player's name | steam id]
amx_flags "?" [flag # | player's name | steam id]
- if the admin does not supply the second argument, it will give a full list of flags. if he does specify, it will list more specific information
amx_flags "add" <name | steam id | user id> [command name]
- if the command name is not supplied, it will flag the player with the command "default," which is created when the plugin starts.
amx_flags "delete" [flag # | player's name | steam id]
amx_flags "del" [flag # | player's name | steam id]
- deletes a flag.
amx_flags "edit" <flag # | name | steam id> <"num" | "number" | "name" | "command"> <change>
amx_flags "change" <flag # | name | steam id> <"num" | "number" | "name" | "command"> <change>
- edits part of a flag:
-> if you use "num" or "number," it will make that flag that number, moving all the others up or down or whatever
-> if you use "name" it will change the name of the player
-> if you use "command" it will change the command of the flag
-> change is obviously the string you want to change to
amx_flagcmds "list" [cmd number | cmd name]
amx_flagcmds "?" [cmd number | cmd name]
- if the admin does not supply the second argument, it will give a full list of flag commands. if he does specify, it will list more specific information
amx_flagcmds "reg" <command name> <command> [event letter]
amx_flagcmds "register" <command name> <command> [event letter]
- registers a command, and if the event letter is not supplied, then it defaults to "a"; read on to find out how i use events
amx_flagcmds "unreg" <command name>
amx_flagcmds "unregister" <command name>
- deletes/unregisters a command; full name must be supplied.
amx_flagcmds "edit" <cmd # | cmd name> <"num" | "number" | "name" | "command" | "event"> <change>
amx_flagcmds "change" <cmd # | cmd name> <"num" | "number" | "name" | "command" | "event"> <change>
- edits part of a flag command:
-> if you use "num" or "number," it will make that flag command that number, moving all the others up or down or whatever
-> if you use "name" it will change the name of the flag command
-> if you use "command" it will change the command of the flag command
-> if you use "event" it will change the event letter of the flag command
the basic idea behind this is that you can set "flag commands" for use with the flags. there's a few preset commands and variables for use within the flag commands, and they are the following:
// Presets are "commands" you put at the beginning of a registered flag command; read on for examples
// execute: executes a command on a player (i.e. "name Player")
// chatmsg: prints a chat message to admins
// hudmsg: shows a HUD message to admins
// consolemsg: prints message in the consoles of admins
// playermsg: prints a chat message to the flagged player
// Variables are what you put if you want something replaced in the command before it is executed
// [name]: displays the name of the user who was flagged
// [steamid]: displays steam id of the user
// [userid]: displays the user id of the user
// [id]: displays the id of the user
// [flagname]: displays the name of the user at the time of the flag
// [admin]: displays the name of the admin who set the flag
// [flag]: displays the flag number
// [command]: displays the command number
"a": called on client_connect
"b": called on client_putinserver
"c": called every time a player spawns
you can use any or all of the events with a command (ex: "a", "cb", whatever)
read before you ask:
amx_flags add "n!nja" -> adds a flag to "n!nja" with the command "default"
amx_flags del 4 -> deletes flag #4, provided there are actually 5 flags
amx_flagcmds reg "slay" "amx_slay #[userid]" "c" -> creates a command that would slay the player every time they spawned
amx_flagcmds reg "kill" "execute kill" -> creates a command that would execute kill on a player when he connects... even though there's no point
amx_flagcmds reg "warn" "hudmsg FLAG: [name] has just entered the server!" -> creates a command that puts up a HUD message to all admins
- if you select a player name from the menu for adding a flag, even if he leaves the server while you're adding commands, it will have saved his name/steam id, so take your time; you still own him
- you can add flags through the menu that are out of the server as well as without the menu
- if you add/register a flag/command, you overwrite an existing version
- you separate commands with semicolons (for flags)
- you can put already registered commands inside another registered command (ex: register "default3" "default; default; default")
- if you use commands when registering a command, it will go by that command's event, not individually by the others
- i think it ignores whitespace when it searches for the commands, but.. you know, we'll see what happens
- you can use any concmd/servercmd when registering commands, but keep in mind that if you want to execute something on a player, you have to use the preset command "execute"
- whatever, be creative... for the server i test this plugin on i did this:
// edit 12/30/06
amx_flagcmds reg "slayround" "amx_slay #[userid]"
amx_flagcmds reg "slayprint" "playermsg You are being permanently slayed for breaking the rules."
amx_flagcmds reg "slay" "slayround; slayprint" "c"
if i do that, even though "slayround" and "slayprint" are event "a" it will still execute it with "c" if you call "slay." now all i do is this:
amx_flags add "playername" "slay"
and that's just like a permanent ban.
most recent notices:
- if a player has amxx immunity, it will be useless to add a flag to his account, because when a flag tries to execute something on a player with immunity, it will delete it from the system (you don't have to tell this to your admins, though ;))
- in order to change your files (flagged.ini or flagcmds.ini) externally (i.e. outside of the game) you must take care so that the original file will not be restored over your overwritten one:
using these steps you can overwrite or modify your files outside of your game, so you can use these files between servers or whatever you need to do
1) change the map and tell any admins not to touch the flags or flag commands (depending on which file you're trying to modify)
2) modify/overwrite/do whatever to the file(s) you're changing
3) change the map again so that the plugin gathers the new files' information into the game
once again, if you have questions or bug reports, post here. the plugin has not changed, i've just come back for a short time to follow-up on it and give any support if needed.