mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-29 23:40:23 +00:00
28 lines
692 B
C#
28 lines
692 B
C#
using SanAndreasUnity.Utilities;
|
|
using UnityEngine;
|
|
|
|
namespace SanAndreasUnity.Behaviours
|
|
{
|
|
|
|
public class UIVehicleSpawner : MonoBehaviour
|
|
{
|
|
public KeyCode spawnKey = KeyCode.V;
|
|
|
|
|
|
private void Update()
|
|
{
|
|
if (Input.GetKeyDown(spawnKey) && GameManager.CanPlayerReadInput())
|
|
{
|
|
if (Ped.Instance != null)
|
|
{
|
|
if (NetUtils.IsServer)
|
|
Vehicles.Vehicle.CreateRandomInFrontOf(Ped.Instance.transform);
|
|
else
|
|
Chat.ChatManager.SendChatMessageToAllPlayersAsLocalPlayer("/veh");
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|