Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

GTA IV C# Modding

Important Resources:

Scripthookdotnet

Visual Studio 13 or up

.Net Framework 4.5.2

Tutorial Start:

1) We will begin with this base script:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using GTA;
using GTA.Native;

namespace Mod
{
    public class Mod : Script
    {

        public Mod()
        {
            //set interval
            Interval = Settings.GetValueInteger("INTERVAL", "SETTINGS", 10000);

            //bind tick event
            this.Tick += new EventHandler(ModTick);

            //bind keydown event.
            this.KeyDown += new GTA.KeyEventHandler(ModKeyDown);


        }

        //tick method, ran every 20 secs
        public void ModTick(object sender, EventArgs e)
        {
            if (Player.Character.isInjured)
            {
                Player.Character.Health = 1000;
            }
        }

        //key down handler
        //A lot of your script will go here
        public void ModKeyDown(object sender, GTA.KeyEventArgs e)
        {

            if (Keys.F6 == e.Key)
            {
                //Add some kind of code to happen on key press
            }
        }
    }
}

Be sure you go to references, and import all listed at the top.

2) I will now provide some code sources below:

Car Spawning

Vector3 vehPos = World.GetNextPositionOnStreet(Player.Character.Position.Around(10.0f));
World.CreateVehicle(new Model("POLICE"), vehPos);

Vehicle Repair

Player.Character.CurrentVehicle.Repair();

Wash Vehicle

Player.Character.CurrentVehicle.Wash();

Max Player Health

Player.Character.Health = 1000;

Max Player Armour

Player.Character.Armor = 1000;

Change Player Model

Player.Model = ("M_Y_SWAT");

Player models can be found here

Change Player Voice

Player.Character.Voice = ("VOICE NAME HERE");

Example of player voice

Player.Character.Voice = ("M_Y_COP_WHITE");

3) Before exporting your script, go to properties and make sure you are using Framework 4.5.2 or above. On your build and assembly name, add ".net" to the end of it!

Now build the file, and add it to your scripts file!

Video Tutorial Here

 

 

User Feedback

Recommended Comments

Warels31

Members
(edited)

Hi, good job thank you

Possible spawn object with animation  ?

Edited by Warels31

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Add a comment...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.