AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Metamod:Source Plugins (https://forums.alliedmods.net/forumdisplay.php?f=76)
-   -   admin_mm - A Mod-Agnostic Admin Plugin (https://forums.alliedmods.net/showthread.php?t=39528)

showdax 12-25-2005 16:44

admin_mm - A Mod-Agnostic Admin Plugin
 
Well I'm finally ready to release this. I'll let the readme do the talking:
Code:

== admin_mm ==

About:

admin_mm is a simple and lean administration plugin for HL2 that works with
almost any mod. The Linux version is special in that it requires no special
offset settings or seperate binaries for each mod, and doesn't need updating
when mod updates come out. The Windows version on the other hand is a bit
gimped right now. It will never be quite like the Linux version, but adding
similar support is planned.

The catch to all of this is that if you're using the Windows version, it
/should/ work on most mods, but commands like admin_spawn will not work.
Those commands use functions defined by the mod and not the engine.

And besides the commands themselves, each command that takes a player name
uses the same format seen in the NemoD plugin. It matches strings within
player names, and takes the following special keywords:

        #a          - Affects all players
        #t[index]  - Affects specified team e.g. #t1
        #[userid]  - Affects specified player by userid, e.g. #123
        #STEAM_[id] - Affects specified player by Steam ID, e.g.
                      #STEAM_0:1:2345

If you don't use a keyword and you do something like "admin_slay j", it'll
slay everyone with the letters j or J in their name.

Oh, and the plugin is by me, dackz. My site is dackz.net, but the place
is a bit low on content at the moment.

History:

        Version 1 - First release!

Release Notes:

As of version 1, only the following commands work in the Windows version:

        admin_slay
        admin_exec
        admin_kick
        admin_ban
        admin_gag
        admin_team
        admin_swapteams
        admin_cvar
        admin_status

Also note that none of the commands affect bots (because it's potentially
unsafe).

Commands:

The console command "find admin_" says this:

"admin_help"
 - Prints help message
"admin_slay"
 - <name> - Slays specified player(s)
"admin_slap"
 - <name> [amount] - Slaps specified player(s)
"admin_exec"
 - <name> <command> - Executes specified command on specified player(s)
"admin_teleport"
 - <name> <x> <y> <z> - Teleports specified player(s)
"admin_kick"
 - <name> [reason] - Kicks specified player(s)
"admin_ban"
 - <name> <minutes> [reason] - Bans specified player(s)
"admin_health"
 - <name> <amount> - Adds health to specified player(s)
"admin_model"
 - <name> <model> - Sets model of specified player(s)
"admin_freeze"
 - <name> <1/0/on/off> - Freezes or unfreezes specified player(s)
"admin_speedy"
 - <name> <1/0/on/off> - Possibly makes player(s) run faster
"admin_noclip"
 - <name> <1/0/on/off> - Enables or disables noclip for specified player(s)
"admin_gag"
 - <name> <1/0/on/off> [text/radio/all] - Enables or disables specified
                                          player(s) from using text or radio
                                          chat.
"admin_url"
 - <name> <url> [hidden: 0/1] - Opens MOTD to specified URL for specified
                                player(s)
"admin_team"
 - <name> <index> - Changes team of specified player(s)
"admin_class"
 - <name> <index> - Changes class of specified player(s) (DOD)
"admin_give"
 - <name> <item> [subtype] - Gives item to specified player(s)
"admin_remove"
 - <name> <item> - Removes item from specified player(s)
"admin_ammo"
 - <name> <ammo name/index> <amount> - Gives ammo to specified player(s)
"admin_spawn"
 - <name> - Respawns specified player(s)
"admin_swapteams"
 - <index> <index> - Swaps specified teams
"admin_cvar"
 - <name> <cheat: 0/1/on/off> <notify: 0/1/on/off> <min: number/off>
  <max: number/off> - Changes settings for specified convar
"admin_restrict"
 - <item> <1/0/on/off> - Restricts specified players from having specified item
"admin_restrictions"
 - Prints item restrictions
"admin_status"
 - <name> - Prints specified players' restrictions, gags, and other stuff

The plugin isn't stable yet though. I'd consider it beta, so don't run it on production servers unless you're feeling daring. The Windows version should be pretty stable though as it doesn't do many interesting things right now, and the Linux version has been working just fine for me, but I haven't tested it in any setting other than my own.

The next version will have per-player weapon restrictions, the ability to get information about the owner of the spray nearest to you, and some other things I'm forgetting. The Windows version will eventually support at least CS:S, DOD:S and HL2:DM. The weapon restrictor will eventually be able to detect when someone picks up an item in mods other than CS:S (DOD:S and HL2:DM have no item_pickup event) and it might eventually be able to block rebuy commands that purchase blocked weapons (right now it'll just let you buy it, then immediately take it away from you.)

I'll be releasing the source code in a bit; I just need to clean up and comment the code. If anyone wants to submit patches or try to add better Windows support, feel free, but make sure to post the patch in this thread.

Also, admin_restrict will only accept valid entity names and will not check to see if the name is actually an item, so make sure you check beforehand. You can generally find weapon names in the mod/scripts/ folder. If you want to restrict hegrenades in CS:S, you'd do "admin_restrict weapon_hegrenade 1". If you want to restrict spades in DOD:S, you'd do "admin_restrict weapon_spade 1".

Downloads: http://dackz.net/projects/admin_mm/

ichthys 12-26-2005 02:03

Cool. About admin_cvar. What does the cheat option do? Enable cheat cvars to change?

showdax 12-26-2005 02:27

Quote:

Originally Posted by ichthys
Cool. About admin_cvar. What does the cheat option do? Enable cheat cvars to change?

It sets or unsets the FCVAR_CHEAT flag on a command or variable, thereby allowing you to set it regardless of sv_cheats. This is especially useful if you want to do something like change the respawn time in DOD:S, which for some reason is a cheat setting.

c0ldfyr3 12-26-2005 12:05

So im guessing your using dlsym for all of the linux functions, and are too lazy to read BAIL's posts on howto accomplish the windows sigs.

Its not exactly fair to release a program which is buggy to one OS and not the other, thats why I take my time with releases o.O

But each to his own heh.

P.S. How do we patch without source ??

showdax 12-26-2005 15:53

Quote:

Originally Posted by c0ldfyr3
So im guessing your using dlsym for all of the linux functions, and are too lazy to read BAIL's posts on howto accomplish the windows sigs.

I'm using the same code CS:S DM uses for finding functions, but yes I'm using dlsym right now. I don't think Valve left the symbol tables in their binaries for no reason, so I don't think they're going anywhere any time soon. That said, my plan was to use the symbol table on Linux first, and then fallback on signature scanning after the fact. I want to develop a smarter scanning system though, something that won't break as easily across updates.

Quote:

Its not exactly fair to release a program which is buggy to one OS and not the other, thats why I take my time with releases o.O
It's not buggy under Windows at all, it just doesn't have as many features. I made this plugin out of necessity and as a learning experience, for my own needs. I don't run a Windows server so it wasn't a high priority, and I haven't messed with the headache of finding functions under Windows.

And as for fairness, it isn't my duty to release plugins for everyone, so I'm not sure where you're getting that notion from.

Quote:

P.S. How do we patch without source ??
When I release the source you can, as I said. I'm in the process of cleaning it up.

c0ldfyr3 12-26-2005 16:07

Maybe they dont know about -s =)

showdax 12-26-2005 17:01

1 Attachment(s)
Okay, here's the source. It still isn't really commented well enough and it's a bit unorganized, but it'll do.

Also, as far as function scanning goes, what I want to do is make the plugin not rely on hard-coded values, but instead it would read signature information from files. I also want it to be able to structure vtables based on information provided from files.

kingpin 12-26-2005 18:26

nice work Showdax, sounds promising.

c0ldfyr3 12-26-2005 22:23

Oh ya lol, forgot to ask, what is "your" meaning of agnostic ?
I know what it means, but just wondering if theres a different description ?

kalhimeo 12-28-2005 06:23

thank you for your plugin, looks nice.


All times are GMT -4. The time now is 11:29.

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