add matchstat

This commit is contained in:
2023-08-17 23:35:20 +02:00
parent 9ad4d4b258
commit 00cf89f461
2 changed files with 42 additions and 1 deletions
+8 -1
View File
@@ -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",
+34
View File
@@ -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<entity> weapons = player.GetMainWeapons()
array<entity> 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 )
}