add matchstat
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
"Name": "fvnkhead.killstat",
|
"Name": "fvnkhead.killstat",
|
||||||
"Description": "Gather kill statistics and sends them to Tone API server.",
|
"Description": "Gather kill statistics and sends them to Tone API server.",
|
||||||
"Version": "3.0.2",
|
"Version": "3.0.2",
|
||||||
"LoadPriority": 1,
|
"LoadPriority": 2,
|
||||||
"RequiredOnClient": false,
|
"RequiredOnClient": false,
|
||||||
"ConVars": [
|
"ConVars": [
|
||||||
{
|
{
|
||||||
@@ -23,6 +23,13 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"Scripts": [
|
"Scripts": [
|
||||||
|
{
|
||||||
|
"Path": "matchstat.nut",
|
||||||
|
"RunOn": "SERVER",
|
||||||
|
"ServerCallback": {
|
||||||
|
"After": "matchStat_Init"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Path": "killstat.nut",
|
"Path": "killstat.nut",
|
||||||
"RunOn": "SERVER",
|
"RunOn": "SERVER",
|
||||||
|
|||||||
@@ -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 )
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user