aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-07-10 16:24:17 +0100
committerGitHub <noreply@github.com>2022-07-10 16:24:17 +0100
commita807348a28981d61d1007a74b3c065ce26bae6b8 (patch)
treec10ea13456b0770fc67a47eb7e1ee3efe32e524d
parent69f60aa53356e23407ce48ad827c6d83bcf596ea (diff)
downloadNorthstarMods-a807348a28981d61d1007a74b3c065ce26bae6b8.tar.gz
NorthstarMods-a807348a28981d61d1007a74b3c065ce26bae6b8.zip
require sv_cheats for kill and explode commands (#414)v1.9.1-rc2
-rw-r--r--Northstar.CustomServers/mod.json6
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/_northstar_cheatcommands.nut4
2 files changed, 7 insertions, 3 deletions
diff --git a/Northstar.CustomServers/mod.json b/Northstar.CustomServers/mod.json
index 555ac8b9..14e1ff63 100644
--- a/Northstar.CustomServers/mod.json
+++ b/Northstar.CustomServers/mod.json
@@ -49,6 +49,10 @@
{
"Name": "ns_should_log_unknown_clientcommands",
"DefaultValue": "1"
+ },
+ {
+ "Name": "ns_allow_kill_commands",
+ "DefaultValue": "0"
}
],
"Scripts": [
@@ -147,4 +151,4 @@
}
}
]
-} \ No newline at end of file
+}
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_northstar_cheatcommands.nut b/Northstar.CustomServers/mod/scripts/vscripts/_northstar_cheatcommands.nut
index 619bfcaf..c79265ac 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/_northstar_cheatcommands.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/_northstar_cheatcommands.nut
@@ -54,7 +54,7 @@ bool function ClientCommandCallbackToggleDemigod( entity player, array<string> a
bool function ClientCommandCallbackKill( entity player, array<string> args )
{
- if ( IsAlive( player ) )
+ if ( IsAlive( player ) && ( GetConVarBool( "sv_cheats" ) || GetConVarBool( "ns_allow_kill_commands" ) ) )
player.Die()
return true
@@ -62,7 +62,7 @@ bool function ClientCommandCallbackKill( entity player, array<string> args )
bool function ClientCommandCallbackExplode( entity player, array<string> args )
{
- if ( IsAlive( player ) )
+ if ( IsAlive( player ) && ( GetConVarBool( "sv_cheats" ) || GetConVarBool( "ns_allow_kill_commands" ) ) )
player.Die( null, null, { scriptType = DF_GIB } )
return true