Console commands and getcvar in MP

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Console commands and getcvar in MP

Post by Rookie One.pl »

Hi,

Two questions:
1. How to execute a console command on a dedicated server's console (stufftext command)?
2. How to get a cvar from various players (in MP)? I thought of something like this:

Code: Select all

local.playerModel = $player[local.playerNum] getcvar(ui_dmplayermodel)
Would it work?

Thanks in advance,

[FPP]Rookie One 8)
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

I'm not sure either is possible.

1. Well there's a couple of commands to try:
stuffcmd
server
cmd
Not sure if any of them work though :?

2. I don't think that's possible :(
Image
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

:)

Post by Rookie One.pl »

Thanks, I'll try them out 8) .
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

:/

Post by Rookie One.pl »

Okay, I've found out that the command I've been looking for is stuffcmd, but I don't know how to use it :oops: . I've exported the script commands list (eventhelp command in console and it says:

Code: Select all

stuffcmd:
         a server-only console command. Usage:
         stuffcmd ( [ StringArg1 ], [ StringArg2 ], [ StringArg3 ], [ StringArg4 ], [ StringArg5 ], [ StringArg6 ] )
or something like this. I tried this:

Code: Select all

stuffcmd(set testvar 1)
but it didn't worked :evil: , it said 'unknown command set'! I tried to put it in brackets:

Code: Select all

stuffcmd("set testvar 1")
and it didn't show the error message, but it also didn't set that cvar :evil: . Can somebody help me with this :?: :?: :?:

Now I'm going to test $player getcvar, I hope that at least this will work with no problems.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Post Reply