Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

Display Name

Can someone convert this .lua mod into .net script?

Recommended Posts

Display Name
---------- SMOKING MOD ----------
function INJURED()
Wait(0)
---PLAYER_ID---
local PLAYER_ID
PLAYER_ID = GET_PLAYER_ID()
if (PLAYER_ID < 0) then Wait(0) return end
local p = {}  GET_PLAYER_CHAR(GET_PLAYER_ID(), p)  local PLAYER_CHAR = p.a
---PLAYER_ID_END
local g = {}  local char_speed = {}
while(HAVE_ANIMS_LOADED("move_injured_upper") == 0)do REQUEST_ANIMS("move_injured_upper") Wait(300)
end
GET_CHAR_SPEED(PLAYER_CHAR, char_speed)
GET_CHAR_HEALTH(PLAYER_CHAR, g)
 if(char_speed.b >= 6.5)and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "move_injured_upper", "idle") == 1)
 then TASK_PLAY_ANIM_SECONDARY_UPPER_BODY(PLAYER_CHAR, "idle", "move_injured_upper", 0.0, 0, 0, 0, 0, 1)
 Wait(500)
 end
 if(g.a <= 150)and(char_speed.b >= 0.8)and(char_speed.b <= 6.5)
 and(IS_BUTTON_PRESSED(0, 5) == 0)and(IS_BUTTON_PRESSED(0, 7) == 0)and(IsKeyPressed(1) == 0)
 and(IsKeyPressed(2) == 0)and(IS_CHAR_IN_ANY_CAR(PLAYER_CHAR) == 0)
 and(IS_CHAR_ON_FOOT(PLAYER_CHAR) == 1)and(IS_CHAR_IN_AIR(PLAYER_CHAR) == 0)
 and(IS_PLAYER_CLIMBING(PLAYER_ID) == 0)and(IS_CHAR_SWIMMING(PLAYER_CHAR) == 0)
 and(IS_CHAR_GETTING_UP(PLAYER_CHAR) == 0)and(IS_CHAR_SITTING_IDLE(PLAYER_CHAR) == 0)
 --and(IS_CHAR_STOPPED(PLAYER_CHAR) == 1)
 --and(IS_CHAR_IN_WATER(PLAYER_CHAR) == 0)
 and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "move_injured_upper", "idle") == 0)
 and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "cellphone", "cellphone_talk") == 0)
 and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "cellphone", "cellphone_text") == 0)
 and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "cellphone", "cellphone_in") == 0)
 and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "cellphone", "cell_text_to_ear") == 0)
 and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "cellphone", "cellphone_out") == 0)
 and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]", "upset_in_bed_idle") == 0)
 and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]", "lie_on_bed_l") == 0)
 and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]", "lie_on_bed_r") == 0)
 and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]_ext", "smoke_stub_out") == 0)
 and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]_scn_idles", "stand_smoke") == 0)
 and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]_spliff", "create_spliff") == 0)
 and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]", "stand_eat_fastfood_2") == 0)
 and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]", "buy_burger_plyr") == 0)
 and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]", "eat_burger_plyr") == 0)
 and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]_server", "eat_burger_plyr") == 0)
 and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]_server", "buy_burger_plyr") == 0)
 and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]", "buy_hotdog_plyr") == 0)
 and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]", "eat_hotdog_plyr") == 0)
 and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]", "eat_nuts_plyr") == 0)
 and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]", "buy_nuts_plyr") == 0)
 and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]_plyr", "buy_drink") == 0)
 and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]_plyr", "partial_drink") == 0)
 and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]_plyr", "create_spliff") == 0)
 
 then
 TASK_PLAY_ANIM_SECONDARY_UPPER_BODY(PLAYER_CHAR, "idle", "move_injured_upper", 0.6, 0, 0, 0, 1, -2)
 Wait(500)
 end
end


function EQ_HGUN()
Wait(0)
---PLAYER_ID---
local PLAYER_ID
PLAYER_ID = GET_PLAYER_ID()
if (PLAYER_ID < 0) then Wait(0) return end
local p = {}  GET_PLAYER_CHAR(GET_PLAYER_ID(), p)  local PLAYER_CHAR = p.a
---PLAYER_ID_END
local crnt_weap = {}  local char_speed = {}
  while(HAVE_ANIMS_LOADED("[email protected]") == 0)do REQUEST_ANIMS("[email protected]") Wait(300)
  end
  GET_CURRENT_CHAR_WEAPON(PLAYER_CHAR, crnt_weap)
  GET_CHAR_SPEED(PLAYER_CHAR, char_speed)
  if(crnt_weap.a == 7)or(crnt_weap.a == 9)then
   if(char_speed.b >= 4.5)then
    if(IS_BUTTON_PRESSED(0, 5) == 0)and(IS_BUTTON_PRESSED(0, 7) == 0)and(IsKeyPressed(1) == 0)
    and(IsKeyPressed(2) == 0)and(IS_CHAR_IN_ANY_CAR(PLAYER_CHAR) == 0)
    and(IS_CHAR_ON_FOOT(PLAYER_CHAR) == 1)and(IS_CHAR_IN_AIR(PLAYER_CHAR) == 0)
    and(IS_PLAYER_CLIMBING(PLAYER_ID) == 0)and(IS_CHAR_SWIMMING(PLAYER_CHAR) == 0)
    and(IS_CHAR_GETTING_UP(PLAYER_CHAR) == 0)and(IS_CHAR_IN_WATER(PLAYER_CHAR) == 0)
    and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]", "holster") == 0)
    and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]", "holster_crouch") == 0)
    and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]", "reload") == 0)
    and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]", "reload_crouch") == 0)
    and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "move_injured_upper", "idle") == 0)
	then HGUN_FLAG = 1
	end
   end
  end
  if(IS_CHAR_SWIMMING(PLAYER_CHAR) == 1)and(HGUN_FLAG == 1)
  then TASK_PLAY_ANIM_SECONDARY_UPPER_BODY(PLAYER_CHAR, "pistol_partial_b", "[email protected]", 0.0, 0, 0, 0, 0, 1)
  HGUN_FLAG = 0 Wait(2000)   
  end
  if(crnt_weap.a ~= 7)and(crnt_weap.a ~= 9)
  or(char_speed.b < 4.5)or(IS_BUTTON_PRESSED(0, 5) == 1)
  or(IS_BUTTON_PRESSED(0, 7) == 1)or(IsKeyPressed(1) == 1)
  or(IsKeyPressed(2) == 1)
  or(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]", "holster") == 1)
  or(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]", "holster_crouch") == 1)
  or(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]", "reload") == 1)
  or(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]", "reload_crouch") == 1)
  or(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "move_injured_upper", "idle") == 1)
  or(IS_CHAR_IN_ANY_CAR(PLAYER_CHAR) == 1)
  or(IS_CHAR_ON_FOOT(PLAYER_CHAR) == 0)or(IS_CHAR_IN_AIR(PLAYER_CHAR) == 1)
  or(IS_PLAYER_CLIMBING(PLAYER_ID) == 1)or(IS_CHAR_SWIMMING(PLAYER_CHAR) == 1)
  or(IS_CHAR_GETTING_UP(PLAYER_CHAR) == 1)or(IS_CHAR_IN_WATER(PLAYER_CHAR) == 1)
  then HGUN_FLAG = 0
  end
  if(HGUN_FLAG == 1)and(IS_CHAR_SWIMMING(PLAYER_CHAR) == 0)and(IS_CHAR_IN_AIR(PLAYER_CHAR) == 0)
  and(IS_PLAYER_CLIMBING(PLAYER_ID) == 0)and(IS_BUTTON_PRESSED(0, 5) == 0)and(IS_BUTTON_PRESSED(0, 7) == 0)
  and(IsKeyPressed(1) == 0)and(IsKeyPressed(2) == 0)
  and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "climb_std", "fall_land") == 0)
  and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "climb_std", "fall_collapse") == 0)
  and(IS_CHAR_GETTING_UP(PLAYER_ID) == 0)and(IS_PED_RAGDOLL(PLAYER_CHAR) == 0)
  and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "jump_std", "jump_inair_l") == 0)
  and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "jump_std", "jump_inair_r") == 0)
  and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "jump_rifle", "jump_inair_l") == 0)
  and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "jump_rifle", "jump_inair_r") == 0)
  and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "jump_std", "jump_takeoff_l") == 0)
  and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "jump_std", "jump_takeoff_r") == 0)
  and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "jump_rifle", "jump_takeoff_l") == 0)
  and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "jump_rifle", "jump_takeoff_r") == 0)
  and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "move_injured_upper", "idle") == 0)
  then
   if(crnt_weap.a == 7)then
   GIVE_WEAPON_TO_CHAR(PLAYER_CHAR, 7, 0, 0) Wait(500)
   end
   if(crnt_weap.a == 9)then
   GIVE_WEAPON_TO_CHAR(PLAYER_CHAR, 9, 0, 0) Wait(500)
   end
   if(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "[email protected]", "pistol_partial_b") == 0)
   and(IS_CHAR_SWIMMING(PLAYER_CHAR) == 0)and(IS_CHAR_IN_AIR(PLAYER_CHAR) == 0)
   and(IS_PLAYER_CLIMBING(PLAYER_ID) == 0)and(IS_BUTTON_PRESSED(0, 5) == 0)and(IS_BUTTON_PRESSED(0, 7) == 0)
   and(IsKeyPressed(1) == 0)and(IsKeyPressed(2) == 0)
   and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "climb_std", "fall_land") == 0)
   and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "climb_std", "fall_collapse") == 0)
   and(IS_CHAR_GETTING_UP(PLAYER_ID) == 0)and(IS_PED_RAGDOLL(PLAYER_CHAR) == 0)
   and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "jump_std", "jump_inair_l") == 0)
   and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "jump_std", "jump_inair_r") == 0)
   and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "jump_rifle", "jump_inair_l") == 0)
   and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "jump_rifle", "jump_inair_r") == 0)
   and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "jump_std", "jump_takeoff_l") == 0)
   and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "jump_std", "jump_takeoff_r") == 0)
   and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "jump_rifle", "jump_takeoff_l") == 0)
   and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "jump_rifle", "jump_takeoff_r") == 0)
   and(IS_CHAR_PLAYING_ANIM(PLAYER_CHAR, "move_injured_upper", "idle") == 0)
   then
   TASK_PLAY_ANIM_SECONDARY_UPPER_BODY(PLAYER_CHAR, "pistol_partial_b", "[email protected]", 2.1, 0, 0, 0, 1, -2)
   end
  end
end

function smoking_main()
Wait(1000)
  while true do
  Wait(0)
  INJURED()
  EQ_HGUN()
  end
end

-- start
smoking_main();

 

Basically it changes running animation for Niko when he is a holding a pistol. How hard would it be to convert this .lua mod into .net script? I have no programming knowledge.

Share this post


Link to post
Share on other sites
Jitnaught
using GTA;
using System;
using System.Windows.Forms;

namespace Anims
{
    public class Anims : Script
    {
        //settings
        bool useGunAnim, useInjuredAnim;
        int healthToShowInjuredAnim;
        
        //gameplay
        bool HGUN = false;

        public Anims()
        {
            useGunAnim = Settings.GetValueBool("use_gun_anim", "settings", true);
            useInjuredAnim = Settings.GetValueBool("use_injured_anim", "settings", true);
            healthToShowInjuredAnim = Settings.GetValueInteger("health_to_start_show_injured_anim", "settings", 50);
            
            Interval = 0;
            Tick += Anims_Tick;
        }

        private void Anims_Tick(object sender, EventArgs e)
        {
            if (useInjuredAnim) Injured();
            if (useGunAnim) EqHgun();
        }

        private float GetCharSpeed(Ped ped)
        {
            var speedPointer = new GTA.Native.Pointer(typeof(float));
            GTA.Native.Function.Call("GET_CHAR_SPEED", ped, speedPointer);
            
            return (float)speedPointer.Value;
        }

        private void EqHgun()
        {
            while (!GTA.Native.Function.Call<bool>("HAVE_ANIMS_LOADED", "[email protected]"))
            {
                GTA.Native.Function.Call("REQUEST_ANIMS", "[email protected]");
                Wait(50);
            }

            float speed = GetCharSpeed(Game.LocalPlayer.Character);
            Weapon weapon = Game.LocalPlayer.Character.Weapons.CurrentType;

            if ((weapon == Weapon.Handgun_Glock || weapon == Weapon.Handgun_DesertEagle)
                    && speed >= 4.5
                    && !GTA.Native.Function.Call<bool>("IS_BUTTON_PRESSED", 0, 5)
                    && !GTA.Native.Function.Call<bool>("IS_BUTTON_PRESSED", 0, 7)
                    && !isKeyPressed(Keys.LButton)
                    && !isKeyPressed(Keys.RButton)
                    && !Game.LocalPlayer.Character.isInVehicle()
                    && GTA.Native.Function.Call<bool>("IS_CHAR_ON_FOOT", Game.LocalPlayer.Character)
                    && !Game.LocalPlayer.Character.isInAir
                    && !GTA.Native.Function.Call<bool>("IS_PLAYER_CLIMBING", Game.LocalPlayer)
                    && !Game.LocalPlayer.Character.isSwimming
                    && !Game.LocalPlayer.Character.isGettingUp
                    && !Game.LocalPlayer.Character.isInWater
                    && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("[email protected]"), "holster")
                    && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("[email protected]"), "holster_crouch")
                    && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("[email protected]"), "reload")
                    && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("[email protected]"), "reload_crouch")
                    && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("move_injured_upper"), "idle"))
            {
                HGUN = true;
            }
            else
            {
                //if wasn't swimming when last checked but is swimming now
                if (Game.LocalPlayer.Character.isSwimming && HGUN)
                {
                    GTA.Native.Function.Call("TASK_PLAY_ANIM_SECONDARY_UPPER_BODY", Game.LocalPlayer.Character, "pistol_partial_b", "[email protected]", 0.0, 0, 0, 0, 0, 1);
                    
                    Wait(2000);
                }

                HGUN = false;
            }

            if (HGUN
                && !Game.LocalPlayer.Character.isRagdoll
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("climb_std"), "fall_land")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("climb_std"), "fall_collapse")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("jump_std"), "jump_inair_l")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("jump_std"), "jump_inair_r")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("jump_std"), "jump_takeoff_l")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("jump_std"), "jump_takeoff_r")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("jump_rifle"), "jump_inair_l")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("jump_rifle"), "jump_inair_r")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("jump_rifle"), "jump_takeoff_l")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("jump_rifle"), "jump_takeoff_r")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("move_injured_upper"), "idle"))
            {
                if (weapon == Weapon.Handgun_Glock)
                {
                    GTA.Native.Function.Call("GIVE_WEAPON_TO_CHAR", Game.LocalPlayer.Character, 7, 0, 0);
                    Wait(500);
                }
                else if (weapon == Weapon.Handgun_DesertEagle)
                {
                    GTA.Native.Function.Call("GIVE_WEAPON_TO_CHAR", Game.LocalPlayer.Character, 9, 0, 0);
                    Wait(500);
                }

                if (!Game.LocalPlayer.Character.isSwimming
                    && !Game.LocalPlayer.Character.isGettingUp
                    && !Game.LocalPlayer.Character.isInAir
                    && !Game.LocalPlayer.Character.isRagdoll
                    && !GTA.Native.Function.Call<bool>("IS_PLAYER_CLIMBING", Game.LocalPlayer)
                    && !GTA.Native.Function.Call<bool>("IS_BUTTON_PRESSED", 0, 5)
                    && !GTA.Native.Function.Call<bool>("IS_BUTTON_PRESSED", 0, 7)
                    && !isKeyPressed(Keys.LButton)
                    && !isKeyPressed(Keys.RButton)
                    && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("[email protected]"), "pistol_partial_b")
                    && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("climb_std"), "fall_land")
                    && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("climb_std"), "fall_collapse")
                    && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("jump_std"), "jump_inair_l")
                    && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("jump_std"), "jump_inair_r")
                    && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("jump_std"), "jump_takeoff_l")
                    && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("jump_std"), "jump_takeoff_r")
                    && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("jump_rifle"), "jump_inair_l")
                    && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("jump_rifle"), "jump_inair_r")
                    && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("jump_rifle"), "jump_takeoff_l")
                    && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("jump_rifle"), "jump_takeoff_r")
                    && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("move_injured_upper"), "idle"))
                {
                    GTA.Native.Function.Call("TASK_PLAY_ANIM_SECONDARY_UPPER_BODY", Game.LocalPlayer.Character, "pistol_partial_b", "[email protected]", 2.1, 0, 0, 0, 1, -2);
                }
            }
        }

        private void Injured()
        {
            while (!GTA.Native.Function.Call<bool>("HAVE_ANIMS_LOADED", "move_injured_upper"))
            {
                GTA.Native.Function.Call("REQUEST_ANIMS", "move_injured_upper");
                Wait(50);
            }
            
            float speed = GetCharSpeed(Game.LocalPlayer.Character);
            
            if (speed >= 6.5 && Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("move_injured_upper"), "idle"))
            {
                GTA.Native.Function.Call("TASK_PLAY_SECONDARY_UPPER_BODY", Game.LocalPlayer.Character, "idle", "move_injured_upper", 0.0, 0, 0, 0, 0, 1);
                Wait(500);
            }
            
            if (Game.LocalPlayer.Character.Health <= healthToShowInjuredAnim && speed >= 0.8 && speed <= 6.5
                && !GTA.Native.Function.Call<bool>("IS_BUTTON_PRESSED", 0, 5)
                && !GTA.Native.Function.Call<bool>("IS_BUTTON_PRESSED", 0, 7)
                && !isKeyPressed(Keys.LButton)
                && !isKeyPressed(Keys.RButton)
                && GTA.Native.Function.Call<bool>("IS_CHAR_ON_FOOT", Game.LocalPlayer.Character)
                && !Game.LocalPlayer.Character.isInAir
                && !GTA.Native.Function.Call<bool>("IS_PLAYER_CLIMBING", Game.LocalPlayer)
                && !Game.LocalPlayer.Character.isSwimming
                && !Game.LocalPlayer.Character.isGettingUp
                && !GTA.Native.Function.Call<bool>("IS_CHAR_SITTING_IDLE", Game.LocalPlayer.Character)
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("move_injured_upper"), "idle")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("cellphone"), "cellphone_talk")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("cellphone"), "cellphone_text")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("cellphone"), "cellphone_in")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("cellphone"), "cell_text_to_ear")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("cellphone"), "cellphone_out")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("[email protected]"), "upset_in_bed_idle")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("[email protected]"), "lie_on_bed_l")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("[email protected]"), "lie_on_bed_r")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("[email protected]_ext"), "smoke_stub_out")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("[email protected]_scn_idles"), "stand_smoke")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("[email protected]_spliff"), "create_spliff")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("[email protected]"), "stand_eat_fastfood_2")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("[email protected]"), "buy_burger_plyr")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("[email protected]"), "eat_burger_plyr")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("[email protected]_server"), "eat_burger_plyr")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("[email protected]_server"), "buy_burger_plyr")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("[email protected]"), "buy_hotdog_plyr")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("[email protected]"), "eat_hotdog_plyr")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("[email protected]"), "eat_nuts_plyr")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("[email protected]"), "buy_nuts_plyr")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("[email protected]_plyr"), "buy_drink")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("[email protected]_plyr"), "partial_drink")
                && !Game.LocalPlayer.Character.Animation.isPlaying(new AnimationSet("[email protected]_plyr"), "create_spliff"))
            {
                GTA.Native.Function.Call("TASK_PLAY_ANIM_SECONDARY_UPPER_BODY", Game.LocalPlayer.Character, "idle", "move_injured_upper", 0.6, 0, 0, 0, 1, -2);
                Wait(500);
            }
         }
    }
}

 

Install by:

 

I don't know if you know this or not, but the script also has an animation for when the player is injured. It seems to be "disabled" in the LUA script, but I "fixed" it in this version. If you don't want the injured animation, just disable it in the INI file.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.