PDA

View Full Version : The basics? (admin junk)


MasterSidious
01-28-2004, 04:15 PM
Ok, so I want to make an admin mod just like everyone else. I have already made the cmds (am...) but how do I password it?
My questions:
1. How do I create a variable that can be changed through a server.cfg? (this is what the password will be in the game)
2. How do I make only the people that enter the password be able to use the cmds?-
Do I add an if statement in the g_cmds.c that is just like the !CheatsOk for every command only it would be for the checking if there was the right password input by the client? If so, how specifically can I do this?
3. How would I add cmds? What kind of syntax should I use?

Thanks!

P.S. Please reply, I know the questions are hard but I'm begging you here :D

phasmatis6
09-03-2008, 03:09 PM
I'm bumping this old thread, because I'm a bit unsure myself of how this would work.

I did a Google Code Search for "server.cfg", and I found a lot of Half Life code. So I tried "default.cfg" and still didn't get much (changelogs and whatnot).

But consider this: JAMP is compiled as a DLL and so..... you can basically do anything. You can use standard Win32 code to open/write/read/close any file you want.

As for logging in, you'd just add new commands in the ClientCommand in g_cmds.c (for example, "amlogin", "amkick", etc.)

http://www.mt-wudan.com/jkamp/g__cmds_8c-source.html#l03074

(It's really awesome that someone is hosting the entire JKA source online, isn't it? o_O)

Now, to keep track of admins I think every player has a unique ID somewhere in their gentity. Or maybe you could track them by entity number. I really haven't messed much with player entities, so you're on your own there.

You also want to check to make sure that non-admins can't use /god and /noclip.

If I ever get around to making an admin system (sorta iffy), I'll post my findings here. =/