Hey guys.
I wanna to make a Medic group
I want to know how can i move a person to base, while he can not walk.
For example
When he's half-healthy and he can not to walk how we can use command move him to Medic place(not TP him ,Drag him)
with command.
Dragging a player?
Discussion in 'Rust Development' started by SoroushMarc, Apr 9, 2018.
-
((I wanna to make a Medic group
I want to know how can i move a person to base, while he can not walk.
For example
When he's half-healthy and he can not to walk how we can use command move him to Medic place(not TP him ,Drag him))))
Code:[ChatCommand("drag")] private void DragCmd(BasePlayer player, string key, string[] args) { BasePlayer DragPlayer = BasePlayer.Find(args[0]); if (DragPlayer == null) { SendReply(player, "Player not found or multiple people found"); } else { if (!DragPlayer.IsWounded()) { SendReply(player, "Player is not wounded!"); } else { MovePosition(DragPlayer, player.transform.position, true); } } } private void MovePosition(BasePlayer player, Vector3 destination, bool sleep) { if (sleep) { player.SetPlayerFlag(BasePlayer.PlayerFlags.ReceivingSnapshot, true); player.MovePosition(destination); player.UpdateNetworkGroup(); player.StartSleeping(); player.SendNetworkUpdateImmediate(false); player.ClearEntityQueue(null); player.ClientRPCPlayer(null, player, "StartLoading"); player.SendFullSnapshot(); } else { player.MovePosition(destination); player.ClientRPCPlayer(null, player, "ForcePositionTo", destination); player.SendNetworkUpdateImmediate(); player.ClearEntityQueue(null); } }
I wrote this code.But there is a problem,when i used this command as if that person TP.
but i want he TP in my Position.
with command -
Check this plugin - Edit Tool