mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-12 23:37:07 +00:00
use only Y euler
This commit is contained in:
parent
fcb5f6be3e
commit
75503c74fd
2 changed files with 4 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using SanAndreasUnity.Behaviours;
|
||||
using SanAndreasUnity.Behaviours.Vehicles;
|
||||
|
@ -143,11 +144,11 @@ namespace SanAndreasUnity.Commands
|
|||
position = CommandManager.ParseVector3(arguments, 1);
|
||||
rotation = player.OwnedPed.transform.rotation;
|
||||
if (numArguments > 4)
|
||||
rotation = Quaternion.Euler(CommandManager.ParseVector3(arguments, 4));
|
||||
rotation = Quaternion.Euler(0f, float.Parse(arguments[4], CultureInfo.InvariantCulture), 0f);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return CommandManager.ProcessCommandResult.Error("Invalid syntax. Example: teleport 2000 10.2 -1000.5 or teleport 2000 10.2 -1000.5 0 45 0");
|
||||
return CommandManager.ProcessCommandResult.Error("Invalid syntax. Example: teleport 2000 10.2 -1234.5 or teleport 2000 10.2 -1234.5 28.3");
|
||||
}
|
||||
|
||||
player.OwnedPed.Teleport(position, rotation);
|
||||
|
|
|
@ -112,7 +112,7 @@ namespace SanAndreasUnity.UI {
|
|||
{
|
||||
Vector3 pos = spawnLocation.position;
|
||||
Vector3 eulers = spawnLocation.rotation.eulerAngles;
|
||||
SendCommand($"/teleport {pos.x} {pos.y} {pos.z} {eulers.x} {eulers.y} {eulers.z}");
|
||||
SendCommand($"/teleport {pos.x} {pos.y} {pos.z} {eulers.y}");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue