Перейти к содержимому
View in the app

A better way to browse. Learn more.

Zloplay community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Release/snippet] Fps Boost - r_fullbright toggle

Featured Replies

Опубликовано:

Hey,

as people keep asking for this shit, i've done a r_fullbright toggle thingy.

Not sure how much more fps you will gain, just try it. IMO it's pretty useless but still...

The message which announces the "toggler" will only appear the 1st and the 2nd time the player spawns. More often would be just annoying i guess. The player can toggle the r_fullbright client dvar by pressing

+actionslot1 button (n by default).

 

It should be working fine with every mod which doesn't set r_fullbright client dvar by default.

And it should work properly in all gamemodes...

 

QRBCw.jpg?1

 

miZwo.jpg?1

 

Instructions:

 

Use method 1 or method2(a or B).

 

Method 1:

 

Paste this onPlayerConnect(); to one of your .gsc files. Below the: level waittill( "connected", player );

 

		if( !isDefined( player.pers[ "message_shown" ] ) )
		player.pers[ "message_shown" ] = 0;

	if( !isDefined( player.pers[ "cur_bright" ] ) )
		player.pers[ "cur_bright" ] = 0;

	player thread watchButton();

 

This goes onPlayerSpawned(); after the self waittill("spawned_player");

 

		if( isDefined( self.pers[ "message_shown" ] ) && self.pers[ "message_shown" ] < 2 )
		self thread infoMessage();

 

Last but not least this to the end of the .gsc file:

infoMessage()
{
self endon("disconnect");
self endon("death");
  self.pers[ "message_shown" ]++;	
wait 0.5;

for( i=0; i<3; i++) {
	self iPrintlnBold("^7Press ^3[{+actionslot 1}] ^7to toggle ^3low graphics");
	wait 2;
}

}


watchButton()
{
self endon("disconnect");

self notifyOnPlayerCommand("dat_dvar", "+actionslot 1");

for(; {
	self waittill( "dat_dvar" );

	self.pers["cur_bright"] = !self.pers["cur_bright"];
	self setClientDvar( "r_fullbright", self.pers["cur_bright"]);

	if( self.pers["cur_bright"] )
		self iPrintlnBold("^7High FPS ^3On");
	else 
		self iPrintlnBold("^7High FPS ^3Off");
}

}

 

Or use this

Method 2:

(a) Assuming you want to add the fullbright toggle to a mod:

1. Download the z_svr_toggle.iwd file and extract it

2. copy-paste the _load.gsc to maps/mp/ folder and the _toggle_graphics.gsc

to your mods maps/mp/gametypes folder.

3. Repack your mod to .iwd (with winrar, 7zip etc.)

 

(in case your mod already has a _load.gsc don't overwrite it. Just copy paste this line:

thread maps\mp\gametypes\_toggle_graphics::init();

to a suitable position in the file)

 

(B) You don't want to add it to a mod, you just want the toggler:

1. Download the z_svr_toggle.iwd file

2. copy-paste it to suitable folder on your server

 

Feel free to change the messages, add other dvars or change the hotkey etc.

 

Virustotal: https://www.virustotal.com/file/7a916ad ... 349776725/

  • 4 weeks later...
Опубликовано:

fbToggle()
{
self notiftyOnPlayerCommand( "AS1", "+actionslot 1" );

for(;
{
	self waittill( "AS1" );
	self setClientDvar( "r_fullbright", 0 );
	self iPrintLnBold( "FPS Booster: ^3On" );

	self waittill( "AS1" );
	self setClientDvar( "r_fullbright", 1 );
	self iPrintLnBold( "FPS Booster: ^3Off" );
}
}

 

Couldn't that work as well? :S

 

Edit: fullbright is pretty handy, can boost my fps up to ~200. :3

Опубликовано:

hmm, i get pretty abd fps, like 60-125, ill check this out :B

Опубликовано:

This thing works a treat, i tested it on a server just to see if it works even though i dont need it, it will be useful for others who do, this way of doing it isnt the best and there are alot faster and ways so you dont need as many threads! This way though does work good so good work!

Опубликовано:
  • Автор
fbToggle()
{
self notiftyOnPlayerCommand( "AS1", "+actionslot 1" );

for(;
{
	self waittill( "AS1" );
	self setClientDvar( "r_fullbright", 0 );
	self iPrintLnBold( "FPS Booster: ^3On" ); //off

	self waittill( "AS1" );
	self setClientDvar( "r_fullbright", 1 );
	self iPrintLnBold( "FPS Booster: ^3Off" ); //on
}
}

 

Couldn't that work as well? :S

Yes sure. Why wouldn't it. (Besides that you confused "on" and "off" and made a typo ;))

Just to clarify why i defined the two variables: the player.pers[ "message_shown" ] is there to be able to to show the message only the first two times the player spawns and not every spawn.

The player.pers[ "cur_bright" ] variable is there to save the current setting of the clientdvar (is it 0 or 1?), as there is no getclientdvar().

The advantage is, that the player never has to press the button (N) twice to change his settings.

(If you use the fbToggle() function as you posted it here, you will actually have to press N twice to change your settings from "off" to "on" when you spawn, if it was set "off" on round-end. (in SnD)

 

this way of doing it isnt the best and there are alot faster and ways so you dont need as many threads!!

 

Uhm, there are only two threads...and you do see, that one of them is only called the first two spawns?

Also a "lot of faster ways", i highly doubt that. (Assmuning it has the same functionality: announcing twice only and monitor the button.)

Show a faster/better way then please...

Опубликовано:
fbToggle()
{
self notiftyOnPlayerCommand( "AS1", "+actionslot 1" );

for(;
{
	self waittill( "AS1" );
	self setClientDvar( "r_fullbright", 0 );
	self iPrintLnBold( "FPS Booster: ^3On" ); //off

	self waittill( "AS1" );
	self setClientDvar( "r_fullbright", 1 );
	self iPrintLnBold( "FPS Booster: ^3Off" ); //on
}
}

 

Couldn't that work as well? :S

Yes sure. Why wouldn't it. (Besides that you confused "on" and "off" and made a typo ;))

Just to clarify why i defined the two variables: the player.pers[ "message_shown" ] is there to be able to to show the message only the first two times the player spawns and not every spawn.

The player.pers[ "cur_bright" ] variable is there to save the current setting of the clientdvar (is it 0 or 1?), as there is no getclientdvar().

The advantage is, that the player never has to press the button (N) twice to change his settings.

(If you use the fbToggle() function as you posted it here, you will actually have to press N twice to change your settings from "off" to "on" when you spawn, if it was set "off" on round-end. (in SnD)

 

this way of doing it isnt the best and there are alot faster and ways so you dont need as many threads!!

 

Uhm, there are only two threads...and you do see, that one of them is only called the first two spawns?

Also a "lot of faster ways", i highly doubt that. (Assmuning it has the same functionality: announcing twice only and monitor the button.)

Show a faster/better way then please...

 

I see where you're getting at, a little off-topic, you mention getClientDvar(), does this mean we can set client sided variables without the obvious self.?

if (self getClientDvar( "customDvar" ) == "" )
   self setClientDvar( "customDvar", 1 );

O.o

Опубликовано:
  • Автор
as there is no getclientdvar().

 

I see where you're getting at, a little off-topic, you mention getClientDvar(), does this mean we can set client sided variables without the obvious self.?

if (self getClientDvar( "customDvar" ) == "" )
   self setClientDvar( "customDvar", 1 );

O.o

Nope, why would you want to set the client dvars without a self or a player anyway?

 

I just said "there is no getclientdvar()" and just showed a workaround which is working in this case.

(As you know that the dvar is always 0 at the beginning/when players connect, since it's cheat protected)

Опубликовано:
as there is no getclientdvar().

 

I see where you're getting at, a little off-topic, you mention getClientDvar(), does this mean we can set client sided variables without the obvious self.?

if (self getClientDvar( "customDvar" ) == "" )
   self setClientDvar( "customDvar", 1 );

O.o

Nope, why would you want to set the client dvars without a self or a player anyway?

 

I just said "there is no getclientdvar()" and just showed a workaround which is working in this case.

 

Sorry. :3 I was really tired. tbh, I'm jealous of you. O.o Your way of thinking is amazing.

  • 3 months later...
Опубликовано:

where is the onPlayerConnect(); ?

Опубликовано:
where is the onPlayerConnect(); ?
Опубликовано:

Thanks ;) used method 2(B)

Опубликовано:
  • Автор
Wow, 1 fps more!

Nice one, thought the same when I checked the screenshots :D

 

Lol. Yes as i obviously had my fps capped to 125 when doing the sceenshots...

It was more to show how shitty the graphic looks with r_fullbright 1, not to show the fps gain.

 

But actually some people with weak graphics cards gain like 30 fps or so.

  • 3 weeks later...
Опубликовано:
2. copy-paste it to suitable folder on your server

I am new to this, but what is meant by this? I'm trying to just use the toggle with my server with no mods

Опубликовано:

And then set my server up with it like I am running a mod?

Опубликовано:

Thank you :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Гость
Ответить в тему...

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу

Важная информация

Используя этот сайт, вы соглашаетесь Условия использования.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.