News:

Come Chat with us live! Learn how HERE!

Main Menu

How do you make admin commands?

Started by DoorKnob, March 03, 2007, 06:17:57 PM

DoorKnob

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

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:

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:


[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


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:

[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


DoorKnob

roud Ex-Leader of the Mighty UVache!

DoorKnob

Umm... everytime i use a new command it restartes the server and it doesn't work. Help!
[^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

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
set g_friendlyfire  1

but you MAY have
g_friendlyfire  1

Also, possibly you did not put 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

set is there, and exec is there

This is BPoff.cfg
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

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

The BPoff.cfg is in my last post
and heres the command block
[command]
command = BPoff
exec    = exec BPoff.cfg
desc    = Disable Unlimited Build Points
levels  = 5 6
roud Ex-Leader of the Mighty UVache!

David

Quote from: DoorKnobset is there, and exec is there

This is BPoff.cfg
//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

It doesn't restart anymore but still
!bpoff
execing BPoff.cfg
usage: set <variable> <value>
roud Ex-Leader of the Mighty UVache!

tuple

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

set g_alienbuildpoints 120
set g_humanbuildpoints 120

into BPoff.cfg.  You could also put

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

Ok Thxs a lot it works perfect now. The cp is a great idea too.
roud Ex-Leader of the Mighty UVache!

tuple

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

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

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

Yea I found out how sorry for asking I was looking at http://mercenariesguild.net, and found some useful stuff.

Rawr

Take a look at this file, this is the admin file for the |COM|AoD| server.
http://com.interpsy.com/hosting/admin.dat

sharrakor

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

simple... You modify the source and recompile.

sharrakor

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

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

Quote from: DavidTo 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

anyone know how to do a !rotationOn and !rotationOff?

i have rotationOn.cfg as

set g_initialMapRotation rotation1
cp "Map Rotation On"


and rotationOff.cfg as

set g_initialMapRotation rotation2
cp "Map Rotation Off"


and my maprotation.cfg is

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

can i play music with this commands?

!musik1
vilz clan for ever!