mirror of
https://git.chasehall.net/Chase/COD-Cfgs.git
synced 2025-06-07 18:17:52 -05:00
Add 'IW4x/userraw/scripts/fpsboost.gsc'
This commit is contained in:
parent
90be370752
commit
a20cff1fe0
64
IW4x/userraw/scripts/fpsboost.gsc
Normal file
64
IW4x/userraw/scripts/fpsboost.gsc
Normal file
@ -0,0 +1,64 @@
|
||||
#include common_scripts\utility;
|
||||
#include maps\mp\_utility;
|
||||
#include maps\mp\gametypes\_hud_util;
|
||||
|
||||
|
||||
init()
|
||||
{
|
||||
level thread onPlayerConnect();
|
||||
}
|
||||
|
||||
onPlayerConnect()
|
||||
{
|
||||
for(;;)
|
||||
{
|
||||
level waittill( "connected", player );
|
||||
|
||||
if( !isDefined( player.message_shown) )
|
||||
player.message_shown = 0;
|
||||
|
||||
if( !isDefined( player.cur_bright ) )
|
||||
player.cur_bright = 0;
|
||||
|
||||
player thread watchButton();
|
||||
player thread onPlayerSpawned();
|
||||
}
|
||||
}
|
||||
|
||||
onPlayerSpawned()
|
||||
{
|
||||
self endon("disconnect");
|
||||
|
||||
for(;;)
|
||||
{
|
||||
self waittill("spawned_player");
|
||||
|
||||
if( !self.message_shown ) {
|
||||
self.message_shown = 1;
|
||||
self iPrintlnBold( "^7Press ^3[{+actionslot 1}] ^7for fullbright." );
|
||||
}
|
||||
|
||||
// Workaround for nightvision, this is very importanto!
|
||||
self _SetActionSlot( 1, "" );
|
||||
}
|
||||
}
|
||||
|
||||
watchButton()
|
||||
{
|
||||
self endon("disconnect");
|
||||
|
||||
self notifyOnPlayerCommand( "fpsboost", "+actionslot 1" );
|
||||
|
||||
for(;;) {
|
||||
self waittill( "fpsboost" );
|
||||
|
||||
self.cur_bright = !self.cur_bright;
|
||||
self setClientDvar( "r_fullbright", self.cur_bright );
|
||||
|
||||
if( self.cur_bright )
|
||||
self iPrintlnBold( "^7^3On" );
|
||||
else
|
||||
self iPrintlnBold( "^7^3Off" );
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user