SanAndreasUnity/Assets/Scripts/Behaviours/UIVehicleSpawner.cs

29 lines
692 B
C#
Raw Normal View History

2021-02-22 19:21:14 +00:00
using SanAndreasUnity.Utilities;
using UnityEngine;
2020-05-31 17:07:22 +00:00
2019-07-05 22:55:42 +00:00
namespace SanAndreasUnity.Behaviours
2020-05-31 17:07:22 +00:00
{
2019-07-05 22:55:42 +00:00
public class UIVehicleSpawner : MonoBehaviour
2020-05-31 17:07:22 +00:00
{
2019-07-05 22:55:42 +00:00
public KeyCode spawnKey = KeyCode.V;
2020-05-31 17:07:22 +00:00
2019-07-05 22:55:42 +00:00
private void Update()
{
if (Input.GetKeyDown(spawnKey) && GameManager.CanPlayerReadInput())
2019-07-05 22:55:42 +00:00
{
if (Ped.Instance != null)
{
2021-02-22 19:21:14 +00:00
if (NetUtils.IsServer)
Vehicles.Vehicle.CreateRandomInFrontOf(Ped.Instance.transform);
else
Chat.ChatManager.SendChatMessageToAllPlayersAsLocalPlayer("/veh");
}
2019-07-05 22:55:42 +00:00
}
}
2020-05-31 17:07:22 +00:00
2019-07-05 21:46:59 +00:00
}
2019-07-05 22:55:42 +00:00
}