Skip to content

Instantly share code, notes, and snippets.

@ikt32
ikt32 / driver.lua
Last active September 21, 2024 19:47
BeamNG Dynamic horizon lock (pitch)
-- This Source Code Form is subject to the terms of the bCDDL, v. 1.1.
-- If a copy of the bCDDL was not distributed with this
-- file, You can obtain one at http://beamng.com/bCDDL-1.1.txt
-- Modified for pitch damping by ikt
-- https://gist.github.com/ikt32/d5995d4fb6c4ffce0c1996f1eff2e716
-- File path: BeamNG.drive\lua\ge\extensions\core\cameraModes
-- Changelog:
-- 2023-01-31: Initial version for 0.27
-- 2023-04-15: Updated for 0.28
@ikt32
ikt32 / input.lua
Last active June 15, 2022 15:27
BeamNG steering assist (Last updated with 0.23.5)
-- This Source Code Form is subject to the terms of the bCDDL, v. 1.1.
-- If a copy of the bCDDL was not distributed with this
-- file, You can obtain one at http://beamng.com/bCDDL-1.1.txt
local M = {}
M.keys = {} -- Backwards compatibility
local MT = {} -- metatable
local keysDeprecatedWarned
MT.__index = function(tbl, key)
@ikt32
ikt32 / LeeC_HBD.cs
Last active August 16, 2022 09:40
Get unsafe struct from GTA Native function
using System;
using System.Runtime.InteropServices;
using GTA;
using GTA.Native;
// shvdn2
public static class SHVNative
{
// These are borrowed from ScriptHookVDotNet's
@ikt32
ikt32 / GlowingDisks.cs
Created August 20, 2019 07:59
Glowing Brake Discs
using System;
using System.Collections.Generic;
using System.Drawing;
using GTA;
using GTA.Math;
using GTA.Native;
static class MathExt
{
public static T Clamp<T>(this T val, T min, T max) where T : IComparable<T>
@ikt32
ikt32 / Compatibility.cpp
Last active August 12, 2019 07:47
LoadMTLib
#include "Compatibility.h"
// You should log what happens when a function isn't found, or something.
//#include "Util/Logger.h"
#include <Windows.h>
#include <string>
namespace MT {
const char* (*GetVersion )() = nullptr;
bool (*GetActive )() = nullptr;
// Warning: These are non-compiling code snippets from a larger project.
// Warning: Defunct, check Compatibility.cpp/h now. This is only kept as a reference.
#include <Windows.h>
namespace MT
{
////Gears.asi integration/////
static HMODULE Module;
static bool FunctionsPresent;

Getting up to speed with scripting for GTA V

Want to create your first GTA V script? There are a few things to think of and know beforehand, which will help you in creating a script mod. This document will briefly explain your options, things you need to prepare, and link some existing guides.

You don't need to be proficient at programming: scripting in games can be a fun way to learn a language and programming concepts.

Useful skills and tools to have

@ikt32
ikt32 / LoadMTLib.cs
Last active March 26, 2019 09:15
LoadLibrary Gears.asi
using System;
using System.IO;
using System.Runtime.InteropServices;
using GTA;
using GTA.Native;
static class Dll
{
[DllImport("kernel32.dll")]
public static extern IntPtr GetModuleHandle(string lpFileName);
@ikt32
ikt32 / TextureListTest.cs
Created January 30, 2018 02:25
Texture list Test
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Text;
using GTA;
using GTA.Native;
struct myTexture
{
@ikt32
ikt32 / guide.md
Last active February 25, 2023 13:11
GTA V modding quick start guide