Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using GTA;
- using System;
- using System.Windows.Forms;
- public class Modification : Script
- {
- public Modification()
- {
- Tick += OnTick;
- KeyDown += OnKeyDown;
- KeyUp += OnKeyUp;
- Interval = 10;
- }
- // Benches coords
- GTA.Math.Vector3[] weightBenches = new GTA.Math.Vector3[] {
- new GTA.Math.Vector3(-1201.322f, -1574.971f, 4.074069f)
- };
- // Benches rotation
- float[] weightBenchesR = new float[] {
- 180
- };
- float maxDistance = 2f;
- void OnTick(object sender, EventArgs e)
- {
- }
- void OnKeyDown(object sender, KeyEventArgs e)
- {
- }
- void OnKeyUp(object sender, KeyEventArgs e)
- {
- Player player = Game.Player;
- Ped playerped = player.Character;
- //UI.Notify(player.Position.ToString());
- if (e.KeyCode == Keys.L)
- {
- //Game.FadeScreenOut(1000);
- //player.CanControlCharacter = false;
- //Wait(1000);
- //playerped.Task.ClearAllImmediately();
- //playerped.Task.StartScenario("WORLD_HUMAN_PUSH_UPS", playerped.Position);
- //Wait(100);
- //player.CanControlCharacter = true;
- //Game.FadeScreenIn(1000);
- for(int i = 0; i < weightBenches.Length; i++)
- {
- if(weightBenches[i].DistanceTo(playerped.Position) < maxDistance)
- {
- Animation("PROP_HUMAN_SEAT_MUSCLE_BENCH_PRESS", weightBenches[i], weightBenchesR[i]);
- }
- }
- } else if(e.KeyCode == Keys.K)
- {
- playerped.Task.ClearAll();
- } else if(e.KeyCode == Keys.R)
- {
- // Just for check coords and rotation
- UI.Notify(playerped.Rotation);
- UI.ShowSubtitle(playerped.Position.ToString());
- }
- }
- void Animation(String scenario, GTA.Math.Vector3 position, float rotation)
- {
- Player player = Game.Player;
- Ped playerped = player.Character;
- Game.FadeScreenOut(1000);
- player.CanControlCharacter = false;
- Wait(1000);
- playerped.Task.ClearAllImmediately();
- playerped.Task.StartScenario(scenario, position);
- playerped.Heading = rotation;
- Wait(100);
- player.CanControlCharacter = true;
- Game.FadeScreenIn(1000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement