Working on ped networking 2

This commit is contained in:
in0finite 2019-04-24 02:50:28 +02:00
parent c60d1ae2d4
commit a5b8e5c51c
3 changed files with 20 additions and 0 deletions

View file

@ -387,6 +387,8 @@ namespace SanAndreasUnity.Behaviours
this.UpdateDamageStuff ();
this.Update_Net();
// IsWalking = IsRunning = false;
if (this.CurrentState != null)

View file

@ -22,6 +22,16 @@ namespace SanAndreasUnity.Behaviours
}
public override void OnStartClient()
{
base.OnStartClient();
if (this.isServer)
return;
this.PlayerModel.Load(m_net_pedId);
}
void Update_Net()
{
m_net_pedId = this.PedDef.Id;

View file

@ -137,6 +137,14 @@ namespace SanAndreasUnity.Behaviours
// used to play weapon sound
AudioSource m_audioSource;
/*
#region SyncVars
[SyncVar] int m_net_id = 0;
[SyncVar] int m_net_ammoInClip = 0;
[SyncVar] int m_net_ammoOutsideOfClip = 0;
#endregion
*/
static Weapon ()