NoClip Fix - Removed NoClipOff - Toggle Hide (#263)
* Usage of Hide is now consistent with NoClip; toggleable Removed obsolete !NoClipOff
This commit is contained in:
parent
1e1e8bbe7b
commit
d5cf4451a2
@ -57,13 +57,11 @@ RegisterClientCommands()
|
||||
scripts\_integration_base::AddClientCommand( "TakeWeapons", true, ::TakeWeaponsImpl );
|
||||
scripts\_integration_base::AddClientCommand( "SwitchTeams", true, ::TeamSwitchImpl );
|
||||
scripts\_integration_base::AddClientCommand( "Hide", false, ::HideImpl );
|
||||
scripts\_integration_base::AddClientCommand( "Unhide", false, ::UnhideImpl );
|
||||
scripts\_integration_base::AddClientCommand( "Alert", true, ::AlertImpl );
|
||||
scripts\_integration_base::AddClientCommand( "Goto", false, ::GotoImpl );
|
||||
scripts\_integration_base::AddClientCommand( "Kill", true, ::KillImpl );
|
||||
scripts\_integration_base::AddClientCommand( "SetSpectator", true, ::SetSpectatorImpl );
|
||||
scripts\_integration_base::AddClientCommand( "LockControls", true, ::LockControlsImpl );
|
||||
scripts\_integration_base::AddClientCommand( "UnlockControls", true, ::UnlockControlsImpl );
|
||||
scripts\_integration_base::AddClientCommand( "PlayerToMe", true, ::PlayerToMeImpl );
|
||||
scripts\_integration_base::AddClientCommand( "NoClip", false, ::NoClipImpl );
|
||||
}
|
||||
@ -300,7 +298,13 @@ LockControlsImpl()
|
||||
return self.name + "^7 is not alive";
|
||||
}
|
||||
|
||||
if ( !IsDefined ( self.isControlLocked ) )
|
||||
{
|
||||
self.isControlLocked = false;
|
||||
}
|
||||
|
||||
if ( !self.isControlLocked )
|
||||
{
|
||||
self freezeControls( true );
|
||||
self God();
|
||||
self Hide();
|
||||
@ -311,21 +315,20 @@ LockControlsImpl()
|
||||
|
||||
self AlertImpl( undefined, info );
|
||||
|
||||
self.isControlLocked = true;
|
||||
|
||||
return self.name + "\'s controls are locked";
|
||||
}
|
||||
|
||||
UnlockControlsImpl()
|
||||
{
|
||||
if ( !IsAlive( self ) )
|
||||
{
|
||||
return self.name + "^7 is not alive";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
self freezeControls( false );
|
||||
self God();
|
||||
self Show();
|
||||
|
||||
self.isControlLocked = false;
|
||||
|
||||
return self.name + "\'s controls are unlocked";
|
||||
}
|
||||
}
|
||||
|
||||
NoClipImpl()
|
||||
@ -333,6 +336,7 @@ NoClipImpl()
|
||||
if ( !IsAlive( self ) )
|
||||
{
|
||||
self IPrintLnBold( "You are not alive" );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !IsDefined ( self.isNoClipped ) )
|
||||
@ -357,19 +361,17 @@ NoClipImpl()
|
||||
else
|
||||
{
|
||||
self SetClientDvar( "sv_cheats", 1 );
|
||||
self SetClientDvar( "cg_thirdperson", 1 );
|
||||
self SetClientDvar( "cg_thirdperson", 0 );
|
||||
self SetClientDvar( "sv_cheats", 0 );
|
||||
|
||||
self God();
|
||||
self Noclip();
|
||||
self Hide();
|
||||
self Show();
|
||||
|
||||
self.isNoClipped = false;
|
||||
|
||||
self IPrintLnBold( "NoClip disabled" );
|
||||
}
|
||||
|
||||
self IPrintLnBold( "NoClip enabled" );
|
||||
}
|
||||
|
||||
HideImpl()
|
||||
@ -380,38 +382,26 @@ HideImpl()
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !IsDefined ( self.isHidden ) )
|
||||
{
|
||||
self.isHidden = false;
|
||||
}
|
||||
|
||||
if ( !self.isHidden )
|
||||
{
|
||||
self SetClientDvar( "sv_cheats", 1 );
|
||||
self SetClientDvar( "cg_thirdperson", 1 );
|
||||
self SetClientDvar( "sv_cheats", 0 );
|
||||
|
||||
if ( !IsDefined( self.savedHealth ) || self.health < 1000 )
|
||||
{
|
||||
self.savedHealth = self.health;
|
||||
self.savedMaxHealth = self.maxhealth;
|
||||
}
|
||||
|
||||
self God();
|
||||
self Hide();
|
||||
|
||||
self.isHidden = true;
|
||||
|
||||
self IPrintLnBold( "You are now ^5hidden ^7from other players" );
|
||||
}
|
||||
|
||||
UnhideImpl()
|
||||
{
|
||||
if ( !IsAlive( self ) )
|
||||
{
|
||||
self IPrintLnBold( "You are not alive" );
|
||||
return;
|
||||
self IPrintLnBold( "Hide enabled" );
|
||||
}
|
||||
|
||||
if ( !IsDefined( self.isHidden ) || !self.isHidden )
|
||||
else
|
||||
{
|
||||
self IPrintLnBold( "You are not hidden" );
|
||||
return;
|
||||
}
|
||||
|
||||
self SetClientDvar( "sv_cheats", 1 );
|
||||
self SetClientDvar( "cg_thirdperson", 0 );
|
||||
self SetClientDvar( "sv_cheats", 0 );
|
||||
@ -421,7 +411,8 @@ UnhideImpl()
|
||||
|
||||
self.isHidden = false;
|
||||
|
||||
self IPrintLnBold( "You are now ^5visible ^7to other players" );
|
||||
self IPrintLnBold( "Hide disabled" );
|
||||
}
|
||||
}
|
||||
|
||||
AlertImpl( event, data )
|
||||
|
@ -147,24 +147,6 @@ let commands = [{
|
||||
sendScriptCommand(gameEvent.Owner, 'LockControls', gameEvent.Origin, gameEvent.Target, undefined);
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'unlockcontrols',
|
||||
description: 'unlocks target player\'s controls',
|
||||
alias: 'ulc',
|
||||
permission: 'Administrator',
|
||||
targetRequired: true,
|
||||
arguments: [{
|
||||
name: 'player',
|
||||
required: true
|
||||
}],
|
||||
supportedGames: ['IW4', 'IW5'],
|
||||
execute: (gameEvent) => {
|
||||
if (!validateEnabled(gameEvent.Owner, gameEvent.Origin)) {
|
||||
return;
|
||||
}
|
||||
sendScriptCommand(gameEvent.Owner, 'UnlockControls', gameEvent.Origin, gameEvent.Target, undefined);
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'noclip',
|
||||
description: 'enable noclip on yourself ingame',
|
||||
@ -180,21 +162,6 @@ let commands = [{
|
||||
sendScriptCommand(gameEvent.Owner, 'NoClip', gameEvent.Origin, gameEvent.Origin, undefined);
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'noclipoff',
|
||||
description: 'disable noclip on yourself ingame',
|
||||
alias: 'nco',
|
||||
permission: 'SeniorAdmin',
|
||||
targetRequired: false,
|
||||
arguments: [],
|
||||
supportedGames: ['IW4', 'IW5'],
|
||||
execute: (gameEvent) => {
|
||||
if (!validateEnabled(gameEvent.Owner, gameEvent.Origin)) {
|
||||
return;
|
||||
}
|
||||
sendScriptCommand(gameEvent.Owner, 'NoClipOff', gameEvent.Origin, gameEvent.Origin, undefined);
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'hide',
|
||||
description: 'hide yourself ingame',
|
||||
@ -210,21 +177,6 @@ let commands = [{
|
||||
sendScriptCommand(gameEvent.Owner, 'Hide', gameEvent.Origin, gameEvent.Origin, undefined);
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'unhide',
|
||||
description: 'unhide yourself ingame',
|
||||
alias: 'unh',
|
||||
permission: 'SeniorAdmin',
|
||||
targetRequired: false,
|
||||
arguments: [],
|
||||
supportedGames: ['IW4', 'IW5'],
|
||||
execute: (gameEvent) => {
|
||||
if (!validateEnabled(gameEvent.Owner, gameEvent.Origin)) {
|
||||
return;
|
||||
}
|
||||
sendScriptCommand(gameEvent.Owner, 'Unhide', gameEvent.Origin, gameEvent.Origin, undefined);
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'alert',
|
||||
description: 'alert a player',
|
||||
|
Loading…
Reference in New Issue
Block a user