SanAndreasUnity/Assets/Scripts/Behaviours/UIVehicleSpawner.cs
2021-02-22 20:21:14 +01:00

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");
}
}
}
}
}