From 61a1199afbac68ba27a3bfefdba42c909ceeeec5 Mon Sep 17 00:00:00 2001 From: NachosChipeados Date: Wed, 15 Jan 2025 14:56:30 -0400 Subject: [PATCH] Update _northstar_cheatcommands.nut --- .../vscripts/_northstar_cheatcommands.nut | 40 ++++++++++++++----- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_northstar_cheatcommands.nut b/Northstar.CustomServers/mod/scripts/vscripts/_northstar_cheatcommands.nut index af3dfea56..61f7fc0e7 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/_northstar_cheatcommands.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/_northstar_cheatcommands.nut @@ -6,27 +6,39 @@ void function NorthstarCheatCommands_Init() AddClientCommandCallback( "noclip", ClientCommandCallbackToggleNoclip ) AddClientCommandCallback( "notarget", ClientCommandCallbackToggleNotarget ) AddClientCommandCallback( "demigod", ClientCommandCallbackToggleDemigod ) + AddClientCommandCallback( "god", ClientCommandCallbackToggleDemigod ) AddClientCommandCallback( "kill", ClientCommandCallbackKill ) AddClientCommandCallback( "explode", ClientCommandCallbackExplode ) + + AddClientCommandCallback( "NOCLIP", ClientCommandCallbackToggleNoclip ) + AddClientCommandCallback( "NOTARGET", ClientCommandCallbackToggleNotarget ) + AddClientCommandCallback( "DEMIGOD", ClientCommandCallbackToggleDemigod ) + AddClientCommandCallback( "GOD", ClientCommandCallbackToggleDemigod ) + AddClientCommandCallback( "KILL", ClientCommandCallbackKill ) + AddClientCommandCallback( "EXPLODE", ClientCommandCallbackExplode ) } bool function ClientCommandCallbackToggleNoclip( entity player, array args ) { if ( !GetConVarBool( "sv_cheats" ) ) return true - if( player.GetParent() ) // change movetype while setparented will crash the server + if ( player.GetParent() ) // change movetype while setparented will crash the server { print( player + " failed noclipping because the entity is parented" ) return true } - - print( player + " TOGGLED NOCLIP" ) if ( player.IsNoclipping() ) + { player.SetPhysics( MOVETYPE_WALK ) + print( player + " TOGGLED NOCLIP OFF" ) + } else + { player.SetPhysics( MOVETYPE_NOCLIP ) - + print( player + " TOGGLED NOCLIP ON" ) + } + return true } @@ -35,10 +47,14 @@ bool function ClientCommandCallbackToggleNotarget( entity player, array if ( !GetConVarBool( "sv_cheats" ) ) return true - print( player + " TOGGLED NOTARGET" ) + if ( player.GetNoTarget() ) + print( player + " TOGGLED NOTARGET OFF" ) + else + print( player + " TOGGLED NOTARGET ON" ) player.SetNoTarget( !player.GetNoTarget() ) player.SetNoTargetSmartAmmo( player.GetNoTarget() ) + return true } @@ -47,13 +63,17 @@ bool function ClientCommandCallbackToggleDemigod( entity player, array a if ( !GetConVarBool( "sv_cheats" ) ) return true - print( player + " TOGGLED DEMIGOD" ) - if ( IsDemigod( player ) ) + { DisableDemigod( player ) + print( player + " TOGGLED DEMIGOD OFF" ) + } else + { EnableDemigod( player ) - + print( player + " TOGGLED DEMIGOD ON" ) + } + return true } @@ -61,7 +81,7 @@ bool function ClientCommandCallbackKill( entity player, array args ) { if ( IsAlive( player ) && ( GetConVarBool( "sv_cheats" ) || GetConVarBool( "ns_allow_kill_commands" ) ) ) player.Die() - + return true } @@ -69,6 +89,6 @@ bool function ClientCommandCallbackExplode( entity player, array args ) { if ( IsAlive( player ) && ( GetConVarBool( "sv_cheats" ) || GetConVarBool( "ns_allow_kill_commands" ) ) ) player.Die( null, null, { scriptType = DF_GIB } ) - + return true }