Raised This Month: $32 Target: $400
 8% 

Flag A Player


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Server Management        Approver:   Brad (55)
Sean D
Junior Member
Join Date: Apr 2006
Old 05-03-2006 , 23:20   Flag A Player
Reply With Quote #1

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"

random stuff:

- 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

credits:

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

changelog:

in the plugin

cvars:
Code:
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")
commands:

amx_flagsmenu
Code:
amx_flagsmenu
 - 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

amx_delflagsmenu
 - brings up the menu for deleting a flag

amx_editflagsmenu [name | steam id | #userid]
 - brings up the menu for editing a flag's commands
amx_currentflags
Code:
amx_currentflags
say /currentflags
 - displays the flags in the server in the console
amx_flags
Code:
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
Code:
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:

Code:
// Presets are "commands" you put at the beginning of a registered flag command; read on for examples
//
// Presets:
// 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
//
// Variables:
// [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
events:

"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)

examples:
Code:
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
read before you ask:

- 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:
Code:
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.

// edit 12/30/06

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:

Code:
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
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

---

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.

// 12/30/06
Attached Files
File Type: sma Get Plugin or Get Source (flagging.sma - 2104 views - 57.9 KB)

Last edited by Sean D; 01-03-2007 at 03:52.
Sean D is offline
Dark Killer
Senior Member
Join Date: May 2005
Location: Kowloon, Hong Kong
Old 05-04-2006 , 04:33  
Reply With Quote #2

Nice, +karma

But what is the difference between the Ultimate Punishment by v3x?
__________________
Dark Killer is offline
Charming
BANNED
Join Date: Nov 2005
Location: Canada
Old 05-04-2006 , 05:53  
Reply With Quote #3

There's a little diffrence.
Charming is offline
Send a message via ICQ to Charming Send a message via AIM to Charming Send a message via MSN to Charming Send a message via Yahoo to Charming
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 05-04-2006 , 12:15  
Reply With Quote #4

-edited-

Last edited by SubStream; 07-12-2006 at 13:01. Reason: Outdated information
SubStream is offline
Sean D
Junior Member
Join Date: Apr 2006
Old 05-04-2006 , 12:18  
Reply With Quote #5

sorry substream, i did forget to put up credit for the idea, but it wasn't your credit.

http://forums.alliedmods.net/showthread.php?t=10170
Sean D is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-04-2006 , 16:17  
Reply With Quote #6

Quote:
Originally Posted by Sean D
sorry substream, i did forget to put up credit for the idea, but it wasn't your credit.

http://forums.alliedmods.net/showthread.php?t=10170
Pwned?
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 05-04-2006 , 18:17  
Reply With Quote #7

-edited-

Last edited by SubStream; 07-12-2006 at 13:02. Reason: Outdated information
SubStream is offline
Sean D
Junior Member
Join Date: Apr 2006
Old 05-04-2006 , 18:30  
Reply With Quote #8

just so we're clear, i got the ideas from that link i posted, even the name "flag"; i had half of it already written when that guy started the more recent thread

unfortunately, neither of the two guys who posted on the original thread have been to the forums lately
Sean D is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-04-2006 , 20:55  
Reply With Quote #9

You should use either Vault, nVault, or Array to store the ids ;)
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Sean D
Junior Member
Join Date: Apr 2006
Old 05-04-2006 , 21:06  
Reply With Quote #10

why
Sean D is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:17.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode