test
This commit is contained in:
@@ -122,9 +122,8 @@
|
|||||||
}, 100)
|
}, 100)
|
||||||
}
|
}
|
||||||
|
|
||||||
mp.events.add("SERVER:GetInFrontPosition", () => {
|
mp.events.add("SERVER:SetInFrontPosition", (entity) => {
|
||||||
let player = mp.players.local;
|
mp.events.callRemote("CLIENT:SET_InFrontOfPos", entity.getOffsetFromInWorldCoords(0, 1, 0));
|
||||||
mp.events.callRemote("CLIENT:SET_InFrontOfPos", player.getOffsetFromInWorldCoords(0, 1, 0));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("SERVER:GetInFrontOfPlayer", (entity: PlayerMp) => {
|
mp.events.add("SERVER:GetInFrontOfPlayer", (entity: PlayerMp) => {
|
||||||
|
|||||||
@@ -46,27 +46,10 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
if (target.Id == player.Id)
|
if (target.Id == player.Id)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Vector3 front = player.GetInFrontOfPosition();
|
target.SetInFrontOf(player);
|
||||||
//front.Z = player.Position.Z;
|
|
||||||
target.Position = front;
|
|
||||||
target.Heading = player.Heading;
|
target.Heading = player.Heading;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("test_cuff2")]
|
|
||||||
public void TestCuff2(Player player, string nameOrId)
|
|
||||||
{
|
|
||||||
if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
|
|
||||||
{
|
|
||||||
ChatService.NotAuthorized(player);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Player target = PlayerService.GetPlayerByNameOrId(nameOrId);
|
|
||||||
if (target.Id == player.Id)
|
|
||||||
return;
|
|
||||||
|
|
||||||
target.TriggerEvent("SERVER:GetInFrontOfPlayer", player);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Command("cuff", "~m~Benutzung: ~s~/cuff [ID]")]
|
[Command("cuff", "~m~Benutzung: ~s~/cuff [ID]")]
|
||||||
public void CmdCuffTest(Player player, string nameOrId)
|
public void CmdCuffTest(Player player, string nameOrId)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
[RemoteEvent("CLIENT:SET_InFrontOfPos")]
|
[RemoteEvent("CLIENT:SET_InFrontOfPos")]
|
||||||
public void SetFrontOfPos(Player player, Vector3 pos)
|
public void SetFrontOfPos(Player player, Vector3 pos)
|
||||||
{
|
{
|
||||||
player.SetData("InFrontOf", pos);
|
player.Position = pos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -317,12 +317,9 @@ namespace ReallifeGamemode.Server.Extensions
|
|||||||
user.Player.SetSharedData("blipColor", blipColor);
|
user.Player.SetSharedData("blipColor", blipColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Vector3 GetInFrontOfPosition(this Player player)
|
public static void SetInFrontOf(this Player player, Entity entity)
|
||||||
{
|
{
|
||||||
player.ResetData("InFrontOf");
|
player.TriggerEvent("SERVER:SetInFrontPosition", entity);
|
||||||
player.TriggerEvent("SERVER:GetInFrontPosition");
|
|
||||||
System.Threading.Thread.Sleep(500);
|
|
||||||
return player.GetData<Vector3>("InFrontOf");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user