mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2025-03-05 07:37:17 +00:00
send next/previous weapon button events
This commit is contained in:
parent
d21a9f5c44
commit
eb13b25a3f
2 changed files with 26 additions and 2 deletions
Assets/Scripts
|
@ -240,12 +240,18 @@ namespace SanAndreasUnity.Behaviours.Peds.States
|
|||
|
||||
public virtual void OnNextWeaponButtonPressed()
|
||||
{
|
||||
m_ped.WeaponHolder.SwitchWeapon (true);
|
||||
if (m_isServer)
|
||||
m_ped.WeaponHolder.SwitchWeapon (true);
|
||||
else if (m_shouldSendButtonEvents)
|
||||
PedSync.Local.OnNextWeaponButtonPressed();
|
||||
}
|
||||
|
||||
public virtual void OnPreviousWeaponButtonPressed()
|
||||
{
|
||||
m_ped.WeaponHolder.SwitchWeapon (false);
|
||||
if (m_isServer)
|
||||
m_ped.WeaponHolder.SwitchWeapon (false);
|
||||
else if (m_shouldSendButtonEvents)
|
||||
PedSync.Local.OnPreviousWeaponButtonPressed();
|
||||
}
|
||||
|
||||
public virtual void OnFlyButtonPressed()
|
||||
|
|
|
@ -118,6 +118,24 @@ namespace SanAndreasUnity.Net
|
|||
m_ped.OnAimButtonPressed();
|
||||
}
|
||||
|
||||
public void OnNextWeaponButtonPressed() => this.CmdOnNextWeaponButtonPressed();
|
||||
|
||||
[Command]
|
||||
void CmdOnNextWeaponButtonPressed()
|
||||
{
|
||||
if (m_ped != null)
|
||||
m_ped.OnNextWeaponButtonPressed();
|
||||
}
|
||||
|
||||
public void OnPreviousWeaponButtonPressed() => this.CmdOnPreviousWeaponButtonPressed();
|
||||
|
||||
[Command]
|
||||
void CmdOnPreviousWeaponButtonPressed()
|
||||
{
|
||||
if (m_ped != null)
|
||||
m_ped.OnPreviousWeaponButtonPressed();
|
||||
}
|
||||
|
||||
|
||||
public void PedStartedEnteringVehicle(Ped ped)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue