Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using GTA;
- namespace SpeechCommands
- {
- class AttachFootTest : Script
- {
- private GTA.Object objectToAttach = null;
- private Bone boneToAttatch = Bone.RightFoot;
- public AttachFootTest()
- {
- this.BindConsoleCommand("GetStuck", this.Command_GetStuck);
- this.BindConsoleCommand("StopTest", this.Command_StopTest);
- }
- private void Command_GetStuck(ParameterCollection args)
- {
- this.objectToAttach = World.CreateObject("OBJECT_NAME_HERE", Game.LocalPlayer.Character.GetBonePosition(this.boneToAttatch).Around(2f));
- if (Game.Exists(this.objectToAttach) && (Game.LocalPlayer.Character.Position.DistanceTo(this.objectToAttach.Position) < 3f))
- {
- this.objectToAttach.FreezePosition = true;
- this.objectToAttach.AttachToPed(Game.LocalPlayer.Character, this.boneToAttatch, Vector3.Zero, Vector3.Zero);
- }
- }
- private void Command_StopTest(ParameterCollection args)
- {
- if (Game.Exists(this.objectToAttach))
- {
- this.objectToAttach.Detach();
- this.objectToAttach.Delete();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement