Page 1 of 1

Getcvar With Println, How to combine:???:

Posted: August 23rd, 2007, 5:29 pm
by yasakresim
Hi all.

Let's say I have a script in my config_mp.cfg that switches between Fps..

Like that:

Code: Select all

bind F2 "vstr fps1"     
seta fps1 "com_maxfps 76;bind F2 vstr fps2"
seta fps2 "com_maxfps 125;bind F2 vstr fps3"
seta fps3 "com_maxfps 333;bind F2 vstr fps1"
What I want is, when I press F2 and select com_maxfps 76 for example, a message should appear in bottom left screen like "Max Fps is 76 now."

I don't want a "say" or "say_team" message such as:

Code: Select all

bind F2 "vstr fps1"     
seta fps1 "say Max Fps is 76 now; com_maxfps 76;bind F2 vstr fps2"
seta fps2 "say Max Fps is 125 now; com_maxfps 125;bind F2 vstr fps3"
seta fps3 "say Max Fps is 333 now; com_maxfps 333;bind F2 vstr fps1"
I want the message "max fps is blabla now" is only seen by me.

This must be done with a mod by using GetCvarInt and PrintLn, I think....

Maybe like this:

Code: Select all

main()
{

if(getCvarInt("com_maxfps") == 76)
{
self iprintln("^1max fps 76");
}

else if(getCvarInt("com_maxfps") == 125)
{
self iprintln("^1max fps 125");
}

else if(getCvarInt("com_maxfps") == 333)
{
self iprintln("^1max fps 333");
}

}
So, everytime I change a Cvar with binding a key, a printLn should appear...

I am new at modding, and I researched for hours but could do nothing yet.
How to make this code work?

Posted: August 23rd, 2007, 6:20 pm
by Marshall
This isn't possible.

Lock the thread v.v

Posted: August 23rd, 2007, 7:03 pm
by [SoE]_Zaitsev
No need to lock.

Just waiting by for NM or Drofder.

Posted: August 23rd, 2007, 7:12 pm
by 9mm
You cant use the iprintln command like that. The command will only work in a map or mod on the server. Another option I can think of is to use the echo command to print it in the console, but you will have to open the console to check your fps. You might be able to add something to the hud which could tell you what your fps was set at, but you will have to ask someone else for that.

Posted: August 24th, 2007, 4:47 pm
by yasakresim
Can't be done with Client Side mod??

I do not mention com_maxfps; it can be an another Cvar.

When a Client (client=me) made a change in a Cvar (r_gamma, snd_volume etc, doesn't matter), then a line should've appeared by PrintLn function.

Like "gamma set to 1.4 now..." etc.

And this line should've only seen by me, not by teams. That's what I'm trying to do...

Posted: August 24th, 2007, 4:49 pm
by Soviet
i think that might have to be server side, why don't you just do cg_dawfps 1 and see what it holds at?

Posted: August 24th, 2007, 5:13 pm
by Drofder2004
The way I do it is as follows...
(This is an example for my jump/normal config switch)

bind I "exec jump.cfg;^3*^2Jump^3*^7"

Basically what this does is...
starts up the jump.cfg
and then prints "*Jump*" to the bottom left.

The way it works is simple, whenever you give the game an incorrect command, it prints..

Incorrect command "<command>"
<command> is replaced by the above.

Posted: August 24th, 2007, 10:49 pm
by [SoE]_Zaitsev
Marshall wrote:This isn't possible.

Lock the thread v.v
:roll:

Posted: August 25th, 2007, 5:14 pm
by yasakresim
Drofder2004 wrote:The way I do it is as follows...
(This is an example for my jump/normal config switch)

bind I "exec jump.cfg;^3*^2Jump^3*^7"

Basically what this does is...
starts up the jump.cfg
and then prints "*Jump*" to the bottom left.

The way it works is simple, whenever you give the game an incorrect command, it prints..

Incorrect command "<command>"
<command> is replaced by the above.
Hey, this is really handy. How I missed it. Thank you :)