Author Topic: !set command  (Read 6015 times)

ACKMAN

  • Posts: 342
  • Turrets: +9/-20
!set command
« on: September 02, 2008, 07:46:26 pm »
I saw this command in some servers months ago. I've searched but i can't find it...

Anyone have a patch or something?

Samurai.mac

  • Posts: 317
  • Turrets: +18/-17
Re: !set command
« Reply #1 on: September 02, 2008, 07:54:21 pm »
My guess is it's just an admin version of the /set command.

ACKMAN

  • Posts: 342
  • Turrets: +9/-20
Re: !set command
« Reply #2 on: September 02, 2008, 08:27:58 pm »
Yes.. eg: !set g_gravity 10. Its like rcon but faster

Syntac

  • Posts: 841
  • Turrets: +118/-104
    • Syntac's Stuff
Re: !set command
« Reply #3 on: September 02, 2008, 11:19:45 pm »
Can't be too hard to code.

Code: (C) [Select]
qboolean G_admin_cvarset( gentity_t *ent, int skiparg )
{
    char name[ 100 ]; // arbitrary value here since I'm lazy
    char value[ MAX_CVAR_VALUE_STRING ];

    G_SayArgv( 1 + skiparg, name, sizeof( name ) );
    strcpy( value, G_SayConcatArgs( 2 + skiparg ) );

    trap_Cvar_Set( name, value );
}
Obviously you'll want to throw in some error checking, but that's the basic idea.

ACKMAN

  • Posts: 342
  • Turrets: +9/-20
Re: !set command
« Reply #4 on: September 03, 2008, 01:00:15 am »
Thanks :D really

kevlarman

  • Posts: 2737
  • Turrets: +291/-295
Re: !set command
« Reply #5 on: September 03, 2008, 01:40:51 am »
Can't be too hard to code.

Code: (C) [Select]
qboolean G_admin_cvarset( gentity_t *ent, int skiparg )
{
    char name[ 100 ]; // arbitrary value here since I'm lazy
    char value[ MAX_CVAR_VALUE_STRING ];

    G_SayArgv( 1 + skiparg, name, sizeof( name ) );
    strcpy( value, G_SayConcatArgs( 2 + skiparg ) );

    trap_Cvar_Set( name, value );
}
Obviously you'll want to throw in some error checking, but that's the basic idea.
that's a little too abusable and/or dangerous
Code: [Select]
qboolean G_admin_cvarset( gentity_t *ent, int skiparg )
{
    char name[ 100 ]; // arbitrary value here since Syntac is lazy
    G_SayArgv( 1 + skiparg, name, sizeof( name ) );

    trap_SendConsoleCommand( va("set \"%s\" \"%s\"\n", name, G_SayConcatArgs( 2 + skiparg ) ) );
}
this is much safer
Quote from: Asvarox link=topic=8622.msg169333#msg169333
Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

Syntac

  • Posts: 841
  • Turrets: +118/-104
    • Syntac's Stuff
Re: !set command
« Reply #6 on: September 04, 2008, 12:49:37 am »
Thanks for correcting my incredibly sloppy code for me. ;)

ACKMAN

  • Posts: 342
  • Turrets: +9/-20
Re: !set command
« Reply #7 on: September 04, 2008, 12:57:13 am »
I like pie  8)

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: !set command
« Reply #8 on: September 06, 2008, 06:51:32 pm »
Worth pointing out this lets admins set anything and everything.  Including the rcon password etc, which can destroy your server with ease.
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.