Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require sv_cheats for kill and explode commands #414

Merged
merged 1 commit into from
Jul 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Northstar.CustomServers/mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
{
"Name": "ns_should_log_unknown_clientcommands",
"DefaultValue": "1"
},
{
"Name": "ns_allow_kill_commands",
"DefaultValue": "0"
}
],
"Scripts": [
Expand Down Expand Up @@ -147,4 +151,4 @@
}
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ 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
}

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
Expand Down