Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 77 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: Forcing FPS
maxxis95
General Member
Since: Aug 28, 2012
Posts: 55
Last: Sep 17, 2012
[view latest posts]
Level 3
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
Share |
maxxis95
General Member
Since: Aug 28, 2012
Posts: 55
Last: Sep 17, 2012
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Thursday, Aug. 30, 2012 09:17 am
bump
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
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;
	}
}
Share |
maxxis95
General Member
Since: Aug 28, 2012
Posts: 55
Last: Sep 17, 2012
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Thursday, Aug. 30, 2012 11:36 am
thanks ill try it, just a question, do you how should it look to disallow fps that are not 250?
Share |
Mitch*
General Member
Since: Jan 23, 2007
Posts: 24
Last: Nov 10, 2012
[view latest posts]
Level 1
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*
Share |
maxxis95
General Member
Since: Aug 28, 2012
Posts: 55
Last: Sep 17, 2012
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Thursday, Aug. 30, 2012 11:47 am
i know about pb but i want it to be inside mod cause your way, it has to be in .cfg
Share |
Tally
General Member
Since: Apr 21, 2005
Posts: 819
Last: Oct 26, 2012
[view latest posts]
Level 7
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.
Share |
maxxis95
General Member
Since: Aug 28, 2012
Posts: 55
Last: Sep 17, 2012
[view latest posts]
Level 3
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
Share |
Tally
General Member
Since: Apr 21, 2005
Posts: 819
Last: Oct 26, 2012
[view latest posts]
Level 7
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.
Share |
maxxis95
General Member
Since: Aug 28, 2012
Posts: 55
Last: Sep 17, 2012
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Thursday, Aug. 30, 2012 12:22 pm
sorry, i actually missed one thing. i want to allow 125 and 250 and one guy already gave me some guidance but i dont understand it tho
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»