Hi All,
I am wondering if anyone has managed to ever be able to toggle between thrirdperson and firstperson view?
It can be chnage in OW2 via the hud,cfg
set scr_thirdperson_enable “1”
but then it is just either on or off until server is restarted. It would be nice if the player was able to choose mid game.
I was trying things like “cg_thirdperson 0;bind [key] on” and ‘off’ but did not work.
Thanks.
SMiLeY
SetFirstPersonView()
{
self setClientDvar( "cg_thirdPerson", "0" );
}
SetThirdPersonView()
{
self setClientDvar( "cg_thirdPerson", "1" );
}
ThirdPersonMonitor()
{
self endon( "disconnect" );
self endon( "death" );
level endon( "game_ended" );
waittillframeend;
if( isDefined( self.pers[ "tps" ] ) )
{
self setClientDvar( "cg_thirdPerson", self.pers[ "tps" ] );
}
if( !isDefined( self.pers[ "tps" ] ) || !self.pers[ "tps" ] )
return;
waittillframeend;
self thread ThirdPersonViewSight();
self thread ThirdPersonViewDeath();
}
ThirdPersonViewSight()
{
self endon( "disconnect" );
self endon( "death" );
level endon( "game_ended" );
oldAds = 0;
firstPersonView = false;
for (;;)
{
wait (0.05);
// Check if the player enable/disable ADS
if ( self playerADS() > oldAds ) {
oldAds = self playerADS();
// Player is enabling ADS
if ( !firstPersonView ) {
self thread SetFirstPersonView();
firstPersonView = true;
}
} else if ( self playerADS() < oldAds ) {
oldAds = self playerADS();
// Player is disabling ADS
if ( firstPersonView ) {
self thread SetThirdPersonView();
firstPersonView = false;
}
}
}
}
ThirdPersonViewDeath()
{
self endon( "disconnect" );
level endon( "game_ended" );
for(;;)
{
self waittill( "death" );
self thread SetThirdPersonView();
}
}
Thanks mate for the quick reply.
Where have you put your script? Maybe a bit different for OW2. Would like to be able to toggle between the two mid game.