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

Have questions about CoD2 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
yasakresim
CJ Wannabe
CJ Wannabe
Posts: 3
Joined: March 3rd, 2007, 12:42 am

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

Post by yasakresim » August 23rd, 2007, 5:29 pm

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?

User avatar
Marshall
CJ Spammer!
CJ Spammer!
Posts: 820
Joined: December 10th, 2005, 11:28 am
Location: UK

Post by Marshall » August 23rd, 2007, 6:20 pm

This isn't possible.

Lock the thread v.v

User avatar
[SoE]_Zaitsev
Core Staff
Core Staff
Posts: 14220
Joined: October 21st, 2004, 7:17 pm
Location: Holland
Contact:

Post by [SoE]_Zaitsev » August 23rd, 2007, 7:03 pm

No need to lock.

Just waiting by for NM or Drofder.
matt101harris wrote:big cock was the first thing that came to my head lol

9mm
CJ Donator
CJ Donator
Posts: 183
Joined: February 14th, 2006, 10:57 pm
Location: USA

Post by 9mm » August 23rd, 2007, 7:12 pm

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.

yasakresim
CJ Wannabe
CJ Wannabe
Posts: 3
Joined: March 3rd, 2007, 12:42 am

Post by yasakresim » August 24th, 2007, 4:47 pm

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...

Soviet
Core Staff
Core Staff
Posts: 7760
Joined: April 23rd, 2005, 9:12 pm
Location: Plano, Texas
Contact:

Post by Soviet » August 24th, 2007, 4:49 pm

i think that might have to be server side, why don't you just do cg_dawfps 1 and see what it holds at?
Image
ImageImageImage
Image
"Zaitsev is a cunt." - Pedsdude

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » August 24th, 2007, 5:13 pm

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.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
[SoE]_Zaitsev
Core Staff
Core Staff
Posts: 14220
Joined: October 21st, 2004, 7:17 pm
Location: Holland
Contact:

Post by [SoE]_Zaitsev » August 24th, 2007, 10:49 pm

Marshall wrote:This isn't possible.

Lock the thread v.v
:roll:
matt101harris wrote:big cock was the first thing that came to my head lol

yasakresim
CJ Wannabe
CJ Wannabe
Posts: 3
Joined: March 3rd, 2007, 12:42 am

Post by yasakresim » August 25th, 2007, 5:14 pm

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 :)

Post Reply

Who is online

Users browsing this forum: No registered users and 42 guests