This repository has been archived by the owner on Jan 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed config and added some other things.
- Loading branch information
Showing
27 changed files
with
237 additions
and
34 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using CommandSystem; | ||
using MEC; | ||
using Sapiox.API; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using UnityEngine; | ||
|
||
namespace Sapiox.Example | ||
{ | ||
public class SpawnFakePlayer : ICommand | ||
{ | ||
public string Command { get; } = "SpawnFakePlayer"; | ||
|
||
public string[] Aliases { get; } = new string[] { "spawnfakeplayer", "spawnfp", "spfakeplayer" }; | ||
|
||
public string Description { get; } = "Spawn fake player."; | ||
|
||
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response) | ||
{ | ||
Player player = Server.GetPlayer(sender); | ||
var fp = new FakePlayer(player.Position, new Quaternion()); | ||
Timing.RunCoroutine(Walk(player, fp)); | ||
response = $"Spawned FakePlayer following the {player.NickName} !"; | ||
return true; | ||
} | ||
|
||
private IEnumerator<float> Walk(Player _dood, FakePlayer _dummy) | ||
{ | ||
for (; ; ) | ||
{ | ||
yield return Timing.WaitForSeconds(0.1f); | ||
try | ||
{ | ||
if (_dood == null) | ||
{ | ||
_dummy.DeSpawn(); | ||
continue; | ||
} | ||
_dummy.MoveState = PlayerMovementState.Walking; | ||
_dummy.MoveDirection = Sapiox.API.Enum.MovementDirection.Forward; | ||
_dummy.RotateToPosition(_dood.Position); | ||
float distance = Vector3.Distance(_dood.Position, _dummy.Position); | ||
|
||
if (distance <= 1.25f) | ||
_dummy.MoveDirection = Sapiox.API.Enum.MovementDirection.None; | ||
} | ||
catch (Exception e) | ||
{ | ||
Log.Error($"Error:\n{e}"); | ||
} | ||
} | ||
} | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-1.14 KB
(0.93%)
Fedora.Example/obj/Debug/Fedora.Example.csproj.AssemblyReference.cache
Binary file not shown.
Empty file.
2 changes: 1 addition & 1 deletion
2
Fedora.Example/obj/Debug/Fedora.Example.csproj.CoreCompileInputs.cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
a03778d4e2a25d28745b492e7993b8b9ad8913c4 | ||
f05195ac0acd94a70140d7d38357d4e7012edb8b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Sapiox.API.Enum | ||
{ | ||
public enum MovementDirection | ||
{ | ||
Forward, | ||
BackWards, | ||
Right, | ||
Left, | ||
None | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
8851858b32884f2e9be752b9d96054fc5c2664c8 | ||
f48e7dd588a0e5b78c24487c6dc4e85053f256b4 |
Binary file not shown.
Binary file not shown.