Getcvar With Println, How to combine:???:
Posted: 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:
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:
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:
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?
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"
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"
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");
}
}
I am new at modding, and I researched for hours but could do nothing yet.
How to make this code work?