Add pos/heading sync netevents
This commit is contained in:
@@ -62,6 +62,9 @@ function addAllNetworkHandlers() {
|
|||||||
addNetworkHandler("ag.itemActionDelayComplete", playerItemActionDelayComplete);
|
addNetworkHandler("ag.itemActionDelayComplete", playerItemActionDelayComplete);
|
||||||
|
|
||||||
addNetworkHandler("ag.weaponDamage", playerDamagedByPlayer);
|
addNetworkHandler("ag.weaponDamage", playerDamagedByPlayer);
|
||||||
|
|
||||||
|
addNetworkHandler("ag.player.position", updatePositionInPlayerData);
|
||||||
|
addNetworkHandler("ag.player.heading", updateHeadingInPlayerData);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
@@ -648,4 +651,16 @@ function setTimeMinuteDuration(client, minuteDuration) {
|
|||||||
triggerNetworkEvent("ag.minuteDuration", client, minuteDuration);
|
triggerNetworkEvent("ag.minuteDuration", client, minuteDuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function updatePositionInPlayerData(client, position) {
|
||||||
|
getPlayerData(client).syncPosition = position;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function updateHeadingInPlayerData(client, heading) {
|
||||||
|
getPlayerData(client).syncHeading = heading;
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
Reference in New Issue
Block a user