Author Topic: How do you make admin commands?  (Read 10792 times)

DoorKnob

  • Posts: 88
  • Turrets: +0/-0
    • http://noobs4boobs.free.fr
How do you make admin commands?
« on: March 03, 2007, 06:17:57 pm »
I once saw someone say !ffoff and !ffon, and i want to do stuff like that on my server.
I would like:
!ffon/off - Turns ff on asnd off
!crazyfun - makes gravity 25 and game speed 1000
!aliens1 - makes aliens stage 1
!aliens2 - makes aliens stage 2
!aliens3 - makes aliens stage 3
!humans1 - makes humans stage 1
!humans2 - makes humans stage 2
!humans3 - makes humans stage 3
!normal - makes everything normal, without restarting
roud Ex-Leader of the Mighty UVache!

tuple

  • Posts: 833
  • Turrets: +97/-80
How do you make admin commands?
« Reply #1 on: March 03, 2007, 07:07:48 pm »
step one, create a config file that will execute the command (or commands) you want to create.  You can put multiple commands in the command file if you want.  For example, my cfg file to enable ff is:

Code: [Select]
set g_friendlyfire  1
cp "Friendly Fire Enabled"


obviously the first command enables FF, the second announces it so noone is taken by surprise :)

I save this as a file called enableff.cfg in the same directory as admin.dat.

Next I need to add a command block to admin.dat to create the command:

Code: [Select]

[command]
command = enableff
exec    = exec enableff.cfg
desc    = Enable Friendly Fire
levels  = 4 5

command is the command name, so here it will be called as !enableff
exec is the command file executed.  You could just put a single command there too.
Desc is what it shows when you do !help enableff
levels are the admin levels who have access to the command.

Example 2.
!startpractice command

Code: [Select]

set sv_hostname "^1}MG{ ^3Practice"
set g_needpass  1                               // toggle password needed to join the server
set g_password "YourPrivatePassword"                               // server password
 

this is saved as startpractice.cfg
Then I add the command block to admin.dat:
Code: [Select]

[command]
command = startpractice
exec    = exec startpractice.cfg
desc    = Password protect server and change server name too
levels  = 5


I have a !endpractice command to revert my settings and make the server public again :)

There are other particulars, but that should get you started :)
Also, watch when you edit admin.dat, if the server reloads while you are editing it your commands will vanish.  If you can't shut down the server while you edit admin.dat, its best to do it at the beginning of a map and when you are done, connect to your server and run !readconfig to load your changes.  They will be available immediately :)

tuple

  • Posts: 833
  • Turrets: +97/-80
How do you make admin commands?
« Reply #2 on: March 03, 2007, 07:18:13 pm »
sorry for the double post but, I put this into }MG{'s wiki for future reference.

http://mercenariesguild.net/index.php?option=com_openwiki&Itemid=46&id=making_tjw_admin_commands

DoorKnob

  • Posts: 88
  • Turrets: +0/-0
    • http://noobs4boobs.free.fr
How do you make admin commands?
« Reply #3 on: March 03, 2007, 08:06:38 pm »
thanks a lot :D
roud Ex-Leader of the Mighty UVache!

DoorKnob

  • Posts: 88
  • Turrets: +0/-0
    • http://noobs4boobs.free.fr
How do you make admin commands?
« Reply #4 on: March 03, 2007, 09:01:36 pm »
Umm... everytime i use a new command it restartes the server and it doesn't work. Help!
Code: [Select]
[^3S^7] ^3|^7R&V^3|S|^1Door^7Knob^3|^7: !BPoff
execing BPoff.cfg
usage: set <variable> <value>
==== ShutdownGame ====
ShutdownGame:
------------------------------------------------------------
roud Ex-Leader of the Mighty UVache!

tuple

  • Posts: 833
  • Turrets: +97/-80
How do you make admin commands?
« Reply #5 on: March 04, 2007, 12:10:58 am »
Notice the
usage: set <variable> <value>

in the output.  Could it be that you have

variable number
instead of
set variable number
?

So, it should be
Code: [Select]
set g_friendlyfire  1

but you MAY have
Code: [Select]
g_friendlyfire  1

Also, possibly you did not put
Code: [Select]
exec in front of the command in the exec section of the command block in admin.dat.

also, post the contents of the cfg file, maybe the problem is in there.

DoorKnob

  • Posts: 88
  • Turrets: +0/-0
    • http://noobs4boobs.free.fr
How do you make admin commands?
« Reply #6 on: March 04, 2007, 12:48:31 am »
set is there, and exec is there

This is BPoff.cfg
Code: [Select]
set g_admin admin.dat

//passwords
set g_needpass 0
//set g_password password   //server password for the users if you set g_needpass to 1
set rconPassword //rcon password
//loading screen
set sv_hostname "^2Noobs4Boobs ^1Excessive"
set g_motd  "^2Welcome to the Noobs4Boobs ^1Excessive ^2Server. ^3You can visit us @ ^1www.noobs4boobs.free.fr"
set g_alienbuildpoints 120
set g_humanbuildpoints 120

// maximum number of clients
set sv_maxclients 18
set sv_Privateclients 2
set sv_Privtepassword
// disallow clients with modified content
set sv_pure 1
// allow downloads from the server
set sv_allowdownload 1
// Minumum rate for connected clients
set sv_minrate 5000
// Maximum rate for connected clients
set sv_maxrate 10000
set sv_dl_maxrate 25000
// Minumum snapshots for connected clients
set sv_minsnaps 10
// Minumum latency for connected clients
set sv_minping 0
// Maximum latency for connected clients
set sv_maxping 444
// enable client map/kick voting by "/callvote" cmd
set g_allowvote 1
// serverside antilag feature
set g_antilag 1
// following the first map, start this rotation
set g_initialMapRotation rotation1
set g_mincommandperiod 1000
set pmove_fixed 0

//after 55 minutes, all build points are removed
set g_suddenDeathTime 45
//after 60 minutes, the game will end as a draw
set timelimit 60

//forces each team to have a similar number of players
set g_teamForceBalance 1


// Number of buildpoints for human team, default 100
set g_humanMaxStage 2
// Maximum human stage (s1=0, s2=1, s3=2)
set g_humanStage2Threshold 20
// threshold for humans to reach stage 2, default 20
set g_humanStage3Threshold 40
// threshold for humans to reach stage 3, default 40
// Number of buildpoints for alien team, default 100
set g_alienMaxStage 2
// Maximum alien stage (s1=0, s2=1, s3=2)
set g_alienStage2Threshold 20
// threshold for aliens to reach stage 2, default 20
set g_alienStage3Threshold 40
// threshold for aliens to reach stage 3, default 40
// gravity setting, default 800
set g_gravity 800
// friendly fire
set g_friendlyfirehumans 0
set g_friendlyfirealiens 0
set  g_friendlyBuildableFire 0
set g_dretchpunt 1
set g_chatTeamPrefix 1
set sv_wwwDownload "0"
set sv_dlURL "0"
set sv_wwwBaseURL " "
set sv_dlURL " "
set sv_wwwCheckPath ""
set sv_wwwDLDisconnected "0"
set sv_wwwFallbackURL " "
set g_layoutAuto 0
set g_adminTeampBan 180
set g_doWarmup 0
set g_warmup 120


//start this map first
map atcs
roud Ex-Leader of the Mighty UVache!

tuple

  • Posts: 833
  • Turrets: +97/-80
How do you make admin commands?
« Reply #7 on: March 04, 2007, 02:15:33 pm »
post the command block in admin.dat that you put in for your command, and post the contents of BPoff.cfg.  I can only think that the error is there.

DoorKnob

  • Posts: 88
  • Turrets: +0/-0
    • http://noobs4boobs.free.fr
How do you make admin commands?
« Reply #8 on: March 04, 2007, 03:37:08 pm »
The BPoff.cfg is in my last post
and heres the command block
Code: [Select]
[command]
command = BPoff
exec    = exec BPoff.cfg
desc    = Disable Unlimited Build Points
levels  = 5 6
roud Ex-Leader of the Mighty UVache!

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
How do you make admin commands?
« Reply #9 on: March 04, 2007, 04:52:41 pm »
Quote from: "DoorKnob"
set is there, and exec is there

This is BPoff.cfg
Code: [Select]
//start this map first
map atcs


If this really is BPoff.cfg, then this is the problem.
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

DoorKnob

  • Posts: 88
  • Turrets: +0/-0
    • http://noobs4boobs.free.fr
How do you make admin commands?
« Reply #10 on: March 04, 2007, 05:30:04 pm »
It doesn't restart anymore but still
Code: [Select]
!bpoff
execing BPoff.cfg
usage: set <variable> <value>
roud Ex-Leader of the Mighty UVache!

tuple

  • Posts: 833
  • Turrets: +97/-80
How do you make admin commands?
« Reply #11 on: March 04, 2007, 07:51:45 pm »
You're gonna make your life a lot easier if you limit whats in BPoff.cfg to the specific changes you want to make.  

TBO, the BPoff.cfg that you posted looks like you copied it out of server.cfg which is why I was confused.

Instead of all of that, just put
Code: [Select]

set g_alienbuildpoints 120
set g_humanbuildpoints 120

into BPoff.cfg.  You could also put
Code: [Select]

cp "Build Points set to 120 per team"

into BPoff.cfg if you want it announced.

The problem with putting all of the other stuff into BPoff.cfg, aside from the problem you are having :) is that when you want to make any major changes it becomes hard to track down where all the references to any of those other settings in BPoff.cfg.

DoorKnob

  • Posts: 88
  • Turrets: +0/-0
    • http://noobs4boobs.free.fr
How do you make admin commands?
« Reply #12 on: March 04, 2007, 08:52:28 pm »
Ok Thxs a lot it works perfect now. The cp is a great idea too.
roud Ex-Leader of the Mighty UVache!

tuple

  • Posts: 833
  • Turrets: +97/-80
How do you make admin commands?
« Reply #13 on: March 04, 2007, 10:02:34 pm »
Hey Doorknob, I'm putting together some documentation of the admin commands that }MG{ has created.  Lots by Khalsa, lots by me too.

It is basically all the created admin commands on my server, some of which may even be useful! :P

 http://mercenariesguild.net/index.php?option=com_openwiki&Itemid=46&id=wiki:admin_commands

-:GoDz:-Devil

  • Guest
How do you make admin commands?
« Reply #14 on: March 18, 2007, 09:56:03 pm »
Would someone help me with a command block for !kickall.
I am trying to figure out how to set one of them on my servers.

tuple

  • Posts: 833
  • Turrets: +97/-80
How do you make admin commands?
« Reply #15 on: March 19, 2007, 12:15:32 am »
Don't know specifically, but the muteall command here should tell you most of what you need to know :)

Why would you want a kick all command anyways?  Presumably, if you have access to admin.dat to make command blocks, you have access to just restart tremded, which would do the same thing.

-:GoDz:-Devil

  • Guest
How do you make admin commands?
« Reply #16 on: March 19, 2007, 01:16:07 am »
Yea I found out how sorry for asking I was looking at http://mercenariesguild.net, and found some useful stuff.

Rawr

  • Posts: 918
  • Turrets: +1/-1
How do you make admin commands?
« Reply #17 on: March 19, 2007, 04:12:24 am »
Take a look at this file, this is the admin file for the |COM|AoD| server.
http://com.interpsy.com/hosting/admin.dat
img]http://dvclan.org/statsig/statsig.php/3826/4.jpg[/img]

sharrakor

  • Posts: 32
  • Turrets: +0/-1
toggle commands
« Reply #18 on: April 01, 2007, 03:06:54 am »
how would i do stuff like increasing the dretch health??

i want a !supadretch command
img]http://img340.imageshack.us/img340/1497/userbar364712sc3.gif[/img]
Can i join Zirra? pls answer
In-Game Name:{SheiKerS}Sharrakor

Caveman

  • Guest
How do you make admin commands?
« Reply #19 on: April 01, 2007, 03:10:17 am »
simple... You modify the source and recompile.

sharrakor

  • Posts: 32
  • Turrets: +0/-1
How do you make admin commands?
« Reply #20 on: April 01, 2007, 11:05:45 am »
no i meant a command to change dretch health
img]http://img340.imageshack.us/img340/1497/userbar364712sc3.gif[/img]
Can i join Zirra? pls answer
In-Game Name:{SheiKerS}Sharrakor

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
How do you make admin commands?
« Reply #21 on: April 01, 2007, 12:51:07 pm »
To do that you need to make a coded in command.
Dretch health, like all weapon and class stats is stored read-only, so it will take more than a quick edit.
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

benmachine

  • Posts: 915
  • Turrets: +99/-76
    • ben's machinery
How do you make admin commands?
« Reply #22 on: April 01, 2007, 06:32:25 pm »
Quote from: "David"
To do that you need to make a coded in command.
Dretch health, like all weapon and class stats is stored read-only, so it will take more than a quick edit.

I'm not sure it'd be that hard, but yes, you would need to modify the code and compile a custom qvm. I think that client stats may be stored in their player info rather than just storing references to the read-only class stats, in which case it would be quite easy.

edit - I realise this doesn't make much sense. I'll try to redeem myself by inventing g_dretchHealth later.
benmachine

n00b pl0x

  • Posts: 2412
  • Turrets: +55/-168
How do you make admin commands?
« Reply #23 on: April 02, 2007, 01:50:28 am »
anyone know how to do a !rotationOn and !rotationOff?

i have rotationOn.cfg as

Code: [Select]
set g_initialMapRotation rotation1
cp "Map Rotation On"


and rotationOff.cfg as

Code: [Select]
set g_initialMapRotation rotation2
cp "Map Rotation Off"


and my maprotation.cfg is

Code: [Select]
rotation1
{
  atcs

  sokolov-1.0

  arachnid2

  meep_b2

  nexus6

  thermal

  tremor

  utcsb2

  niveus

  sedna-beta3

  ancient_remains_1-0

  atcs3

  atcszalpha-b2

  thermal-b2

  gloom3t

  outpost_p4_beta3

  sedna-beta3
}

rotation2
{

}


I was hoping leaving an empty rotation would just make it never change...but it didnt work that way :S
will sort out my sig, or I will get banned.

HOW DO I SORTED SIG?

[evilz]Sedda

  • Posts: 5
  • Turrets: +0/-0
?????
« Reply #24 on: April 04, 2007, 04:26:00 pm »
can i play music with this commands?

!musik1
vilz clan for ever!