mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2025-02-24 11:17:11 +00:00
working on player requests 2
This commit is contained in:
parent
6803d56cbc
commit
2e9c3ca3e0
1 changed files with 42 additions and 0 deletions
|
@ -3,6 +3,8 @@ using UnityEngine;
|
|||
using Mirror;
|
||||
using SanAndreasUnity.Utilities;
|
||||
using SanAndreasUnity.Behaviours;
|
||||
using SanAndreasUnity.Behaviours.Vehicles;
|
||||
using System.Linq;
|
||||
|
||||
namespace SanAndreasUnity.Net
|
||||
{
|
||||
|
@ -82,6 +84,46 @@ namespace SanAndreasUnity.Net
|
|||
F.RunExceptionSafe( () => m_player.OwnedPed.PlayerModel.Load(Ped.RandomPedId) );
|
||||
}
|
||||
|
||||
public void RequestSuicide()
|
||||
{
|
||||
this.CmdRequestSuicide();
|
||||
}
|
||||
|
||||
[Command]
|
||||
void CmdRequestSuicide()
|
||||
{
|
||||
if (m_player.OwnedPed != null)
|
||||
Destroy(m_player.OwnedPed.gameObject);
|
||||
}
|
||||
|
||||
public void RequestToDestroyAllVehicles()
|
||||
{
|
||||
this.CmdRequestToDestroyAllVehicles();
|
||||
}
|
||||
|
||||
[Command]
|
||||
void CmdRequestToDestroyAllVehicles()
|
||||
{
|
||||
foreach (var v in Vehicle.AllVehicles.ToArray())
|
||||
{
|
||||
Destroy(v.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
public void RequestTeleport(Vector3 pos, Quaternion rot)
|
||||
{
|
||||
this.CmdRequestTeleport(pos, rot);
|
||||
}
|
||||
|
||||
[Command]
|
||||
void CmdRequestTeleport(Vector3 pos, Quaternion rot)
|
||||
{
|
||||
if (m_player.OwnedPed != null)
|
||||
{
|
||||
m_player.OwnedPed.Teleport(pos, rot);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue