aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/_mapspawn.gnut
diff options
context:
space:
mode:
authorlaundmo <laurinschmidt2001@gmail.com>2022-02-05 22:54:23 +0100
committerBarichello <artur@barichello.me>2022-02-10 17:51:54 -0300
commitba987a7c34ff7e46a0daaea434fcb6aab43113bc (patch)
treeb196df5d4bfdcef0f3f3c40eb608bead94019710 /Northstar.CustomServers/mod/scripts/vscripts/_mapspawn.gnut
parent5d51cdaabb4e88bf61414f5c2c7fba278aef7c6b (diff)
downloadNorthstarMods-ba987a7c34ff7e46a0daaea434fcb6aab43113bc.tar.gz
NorthstarMods-ba987a7c34ff7e46a0daaea434fcb6aab43113bc.zip
Allow for adding a client command notify callback
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/_mapspawn.gnut')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/_mapspawn.gnut11
1 files changed, 10 insertions, 1 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_mapspawn.gnut b/Northstar.CustomServers/mod/scripts/vscripts/_mapspawn.gnut
index 73e76910..1d16b9fa 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/_mapspawn.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/_mapspawn.gnut
@@ -94,6 +94,8 @@ global struct SvGlobals
table<string, array<void functionref( entity ent )> >onEntityChangedTeamCallbacks
table<string, bool functionref( entity player, array<string>args )> clientCommandCallbacks
+ table<string, array<void functionref( entity player, array<string>args )> > notifyClientCommandCallbacks
+
array<void functionref()>[ eGameState._count_ ] gameStateEnterCallbacks
bool allowPointsOverLimit = false
@@ -204,7 +206,14 @@ var function CodeCallback_ClientCommand( entity player, array<string> args )
//Assert( commandString in svGlobal.clientCommandCallbacks )
if ( commandString in svGlobal.clientCommandCallbacks )
{
- return svGlobal.clientCommandCallbacks[ commandString ]( player, args )
+ var result = svGlobal.clientCommandCallbacks[ commandString ]( player, args )
+ if ( commandString in svGlobal.notifyClientCommandCallbacks )
+ {
+ foreach ( callbackfunc in svGlobal.notifyClientCommandCallbacks[ commandString ]){
+ callbackfunc(player, args)
+ }
+ }
+ return result
}
else
{