diff --git a/mod.json b/mod.json index d41170f..44c87cd 100644 --- a/mod.json +++ b/mod.json @@ -2,7 +2,7 @@ "Name": "fvnkhead.killstat", "Description": "Gather kill statistics and sends them to Tone API server.", "Version": "3.0.2", - "LoadPriority": 1, + "LoadPriority": 2, "RequiredOnClient": false, "ConVars": [ { @@ -23,6 +23,13 @@ } ], "Scripts": [ + { + "Path": "matchstat.nut", + "RunOn": "SERVER", + "ServerCallback": { + "After": "matchStat_Init" + } + }, { "Path": "killstat.nut", "RunOn": "SERVER", diff --git a/mod/scripts/vscripts/matchstat.nut b/mod/scripts/vscripts/matchstat.nut new file mode 100644 index 0000000..1c1984f --- /dev/null +++ b/mod/scripts/vscripts/matchstat.nut @@ -0,0 +1,34 @@ +global function matchStat_Init + +void function matchStat_Init(){ + // AddCallback_OnPlayerRespawned( TrackWeapons ) + AddCallback_OnPlayerGetsNewPilotLoadout( TrackWeaponsOnChange ) + AddCallback_OnPilotBecomesTitan( TrackTitanWeaponOnBecome ) +} + +void function TrackWeapons( entity player ) { + array weapons = player.GetMainWeapons() + array offhand = player.GetOffhandWeapons() + foreach(entity weapon in weapons){ + AddCallback_OnWeaponFired(weapon, void function(WeaponPrimaryAttackParams attackParams) : (weapon, player){ + print("weapon fired") + } ) + } +} + +void function TrackTitanWeapons( entity player ){ + +} + +var function UseWeaponCallback(var weapon, var player){ + print("weapon used") +} + + +void function TrackWeaponsOnChange( entity player, PilotLoadoutDef loadout ) { + TrackWeapons( player ) +} + +void function TrackTitanWeaponOnBecome( entity player, entity titan ){ + TrackTitanWeapons( player ) +} \ No newline at end of file