aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-04-14 00:37:27 +0100
committerGeckoEidechse <gecko.eidechse+git@pm.me>2022-04-19 23:07:48 +0200
commitffdf44de4aed8e34cdc1d749193271ac80facaf3 (patch)
tree33047ed462c806f47d036a56b910c70edb27010b /Northstar.CustomServers/mod/scripts
parent4af93f01e625e465e4756226548fcfb6bba7e5da (diff)
downloadNorthstarMods-ffdf44de4aed8e34cdc1d749193271ac80facaf3.tar.gz
NorthstarMods-ffdf44de4aed8e34cdc1d749193271ac80facaf3.zip
move devcommands to northstar.customservers (#300)
Diffstat (limited to 'Northstar.CustomServers/mod/scripts')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/_northstar_cheatcommands.nut69
1 files changed, 69 insertions, 0 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_northstar_cheatcommands.nut b/Northstar.CustomServers/mod/scripts/vscripts/_northstar_cheatcommands.nut
new file mode 100644
index 00000000..619bfcaf
--- /dev/null
+++ b/Northstar.CustomServers/mod/scripts/vscripts/_northstar_cheatcommands.nut
@@ -0,0 +1,69 @@
+untyped
+global function NorthstarCheatCommands_Init
+
+void function NorthstarCheatCommands_Init()
+{
+ AddClientCommandCallback( "noclip", ClientCommandCallbackToggleNoclip )
+ AddClientCommandCallback( "notarget", ClientCommandCallbackToggleNotarget )
+ AddClientCommandCallback( "demigod", ClientCommandCallbackToggleDemigod )
+ AddClientCommandCallback( "kill", ClientCommandCallbackKill )
+ AddClientCommandCallback( "explode", ClientCommandCallbackExplode )
+}
+
+bool function ClientCommandCallbackToggleNoclip( entity player, array<string> args )
+{
+ if ( !GetConVarBool( "sv_cheats" ) )
+ return true
+
+ print( player + " TOGGLED NOCLIP" )
+
+ if ( player.IsNoclipping() )
+ player.SetPhysics( MOVETYPE_WALK )
+ else
+ player.SetPhysics( MOVETYPE_NOCLIP )
+
+ return true
+}
+
+bool function ClientCommandCallbackToggleNotarget( entity player, array<string> args )
+{
+ if ( !GetConVarBool( "sv_cheats" ) )
+ return true
+
+ print( player + " TOGGLED NOTARGET" )
+
+ player.SetNoTarget( !player.GetNoTarget() )
+ player.SetNoTargetSmartAmmo( player.GetNoTarget() )
+ return true
+}
+
+bool function ClientCommandCallbackToggleDemigod( entity player, array<string> args )
+{
+ if ( !GetConVarBool( "sv_cheats" ) )
+ return true
+
+ print( player + " TOGGLED DEMIGOD" )
+
+ if ( IsDemigod( player ) )
+ DisableDemigod( player )
+ else
+ EnableDemigod( player )
+
+ return true
+}
+
+bool function ClientCommandCallbackKill( entity player, array<string> args )
+{
+ if ( IsAlive( player ) )
+ player.Die()
+
+ return true
+}
+
+bool function ClientCommandCallbackExplode( entity player, array<string> args )
+{
+ if ( IsAlive( player ) )
+ player.Die( null, null, { scriptType = DF_GIB } )
+
+ return true
+}