test command

This commit is contained in:
2021-04-06 20:23:55 +02:00
parent a106b916dc
commit b993485906
2 changed files with 5 additions and 9 deletions

View File

@@ -129,12 +129,8 @@
mp.events.callRemote("CLIENT:SET_InFrontOfPos", entity.getOffsetFromInWorldCoords(0, 1, 0)); mp.events.callRemote("CLIENT:SET_InFrontOfPos", entity.getOffsetFromInWorldCoords(0, 1, 0));
}); });
mp.events.add("SERVER:GetInFrontOfPlayer", (entity: PlayerMp) => { mp.events.add("attach to Player", (entity: PlayerMp) => {
let player = mp.players.local; entity.attachTo(mp.players.local.handle, 0, 0, 1, 0, 0, 0, 0, false, false, false, true, 2, true);
let result = xyInFrontOfPos(entity.position, entity.heading, 0.5);
result.z = player.position.z;
mp.players.local.heading = entity.heading;
mp.players.local.position = result;
}); });
function xyInFrontOfPos(pos, heading, dist): Vector3Mp { function xyInFrontOfPos(pos, heading, dist): Vector3Mp {

View File

@@ -45,9 +45,9 @@ namespace ReallifeGamemode.Server.Commands
Player target = PlayerService.GetPlayerByNameOrId(nameOrId); Player target = PlayerService.GetPlayerByNameOrId(nameOrId);
if (target.Id == player.Id) if (target.Id == player.Id)
return; return;
//target.SetInFrontOf(player);
target.SetInFrontOf(player); //target.Heading = player.Heading;
target.Heading = player.Heading; player.TriggerEvent("attach to Player", target);
} }
[Command("cuff", "~m~Benutzung: ~s~/cuff [ID]")] [Command("cuff", "~m~Benutzung: ~s~/cuff [ID]")]