1
0
mirror of https://git.chasehall.net/Chase/COD-Cfgs.git synced 2025-06-07 18:27:54 -05:00
COD-Cfgs/IW4x/userraw/scripts/fpsboost.gsc
2020-12-07 02:52:59 +00:00

64 lines
1.1 KiB
Plaintext

#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" );
}
}