Author |
Topic: Forcing FPS |
maxxis95 |
General Member Since: Aug 28, 2012 Posts: 55 Last: Sep 17, 2012 [view latest posts] |
|
|
Category: CoD2 Scripting Posted: Wednesday, Aug. 29, 2012 12:58 pm |
|
Hello,
so what I want to create it is clientcvar forcing. When player's FPS is not set to 250, it automaticaly changes it to 250. I already got some help but I don't quite understand it so I ask you to help me.
Here are guidance I have:
check.menu
Code: #include "ui_mp/menudef.h"
{
menuDef
{
name "check"
rect 0 0 640 480
focuscolor GLOBAL_FOCUSED_COLOR
style WINDOW_STYLE_EMPTY
onopen
{
uiScript openMenuOnDvar com_maxfps 10000 cheat;
close check
}
}
}
So as much I understand, it open cheat.menu when fps is set to 1000. I wonder where should I write all other FPS that are not allowed (other than 250) and how should that look?
cheat.menu
Code: #include "ui_mp/menudef.h"
{
menuDef
{
name "cheat"
rect 0 0 640 480
focuscolor GLOBAL_FOCUSED_COLOR
style WINDOW_STYLE_EMPTY
onOpen
{
close cheat
}
onClose
{
uiScript "quit"
}
onEsc
{
uiScript "quit"
}
}
}
I believe this makes /quit to player who has FPS set to 10000.
So if I understand all these things correctly, does check.menu really have to open cheat.menu? Can't it just open some .gsc file? And how should I write to open a .gsc file?
Thanks in advance |
|
|
|
maxxis95 |
General Member Since: Aug 28, 2012 Posts: 55 Last: Sep 17, 2012 [view latest posts] |
|
|
|
serthy |
General Member Since: Sep 8, 2010 Posts: 482 Last: Jun 28, 2013 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Thursday, Aug. 30, 2012 10:59 am |
|
i dunno if it is working:
precache your cheat.menu and add sth like that
Code: onOpen
{
scriptMenuResponse "cheater";
}
and check the response
Code: onMenuResponse()
{
while( isDefined( player ) )
{
player waittill( menu , response );
if( isDefined( response ) && response == "cheater" )
player.is_cheater = true;
}
} |
|
|
|
maxxis95 |
General Member Since: Aug 28, 2012 Posts: 55 Last: Sep 17, 2012 [view latest posts] |
|
|
|
Mitch* |
|
General Member Since: Jan 23, 2007 Posts: 24 Last: Nov 10, 2012 [view latest posts] |
|
|
Category: CoD2 Scripting Posted: Thursday, Aug. 30, 2012 11:41 am |
|
maxxis95 writes...Quote: thanks ill try it, just a question, do you how should it look to disallow fps that are not 250?
If your server runs punkbuster. Then you can use pb to force it to be 250 or a range.
Code:
PB_SV_CVAR com_maxfps IN 250
PB_SV_CVAR com_maxfps IN 85 250
PB_SV_Cvar [Cvar_name] [IN/OUT/INCLUDE/EXCLUDE] [Param1] [optional_Param2]
Source: http://www.evenbalance.com/publications/admins/#commands
you can set it too using code inside cod:
Code:
self setClientCvar("com_maxfps", 250);
edited on Aug. 30, 2012 04:42 am by Mitch* |
|
|
|
maxxis95 |
General Member Since: Aug 28, 2012 Posts: 55 Last: Sep 17, 2012 [view latest posts] |
|
|
|
Tally |
General Member Since: Apr 21, 2005 Posts: 819 Last: Oct 26, 2012 [view latest posts] |
|
|
Category: CoD2 Scripting Posted: Thursday, Aug. 30, 2012 11:54 am |
|
maxxis95 writes...Quote: thanks ill try it, just a question, do you how should it look to disallow fps that are not 250?
There is no way to disallow certain settings for clients, because there is no way to return what cvar any particular player has - in other words, there is no function like this:
Code: player getClientCvar( "com_maxfps" );
If there was such a function, we could do wonderful things like prevent certain settings, but there isn't so we can't.
The only thing you can do is set a particular setting on all players connecting, and just hope that they all like that setting.
To do it, see Mitch's post above - he tells you how to set the cvar on all players. |
|
|
|
maxxis95 |
General Member Since: Aug 28, 2012 Posts: 55 Last: Sep 17, 2012 [view latest posts] |
|
|
Category: CoD2 Scripting Posted: Thursday, Aug. 30, 2012 12:10 pm |
|
Code: {
menuDef
{
name "check"
rect 0 0 640 480
focuscolor GLOBAL_FOCUSED_COLOR
style WINDOW_STYLE_EMPTY
onopen
{
uiScript openMenuOnDvar com_maxfps 10000 cheat;
close check
}
}
}
so im wondering where should i write all fps that are not 250 cause obv i will ahve to write all those numbers except 250 but my question is where and how should that look like? any examples |
|
|
|
Tally |
General Member Since: Apr 21, 2005 Posts: 819 Last: Oct 26, 2012 [view latest posts] |
|
|
Category: CoD2 Scripting Posted: Thursday, Aug. 30, 2012 12:16 pm |
|
I think you missed the point - you don't need to create a special menu, precache it, open it on a player, in order to set com_maxFPS to 1000 on a player - you can do it much easier with a script:
Code: self setClientCvar( "com_maxfps", 1000 );
Do that in any GSC file you want, either as a player connects, or once they've spawned. |
|
|
|
maxxis95 |
General Member Since: Aug 28, 2012 Posts: 55 Last: Sep 17, 2012 [view latest posts] |
|
|
|