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