Skip to content

Instantly share code, notes, and snippets.

import numpy as np
import matplotlib.pyplot as plt
from functools import cache
def normalize_vecs(vecs):
return vecs / np.linalg.norm(vecs, axis=1)[:, np.newaxis]
@cache
[ConsoleCommand]
public static unsafe void TestTaskData()
{
// TODO: search for the pattern once only
IntPtr addr = Game.FindPattern("48 8B 0D ?? ?? ?? ?? 4A 8B 04 C1 44 39 10 74 16");
addr += *(int*)(addr + 3) + 7;
CTaskDataInfoManager* taskDataMgr = (CTaskDataInfoManager*)addr;
for (int i = 0; i < taskDataMgr->aTaskData.Count; i++)
public static CVehicleModelInfoVarGlobal** gVehicleModelInfoVarGlobal = null;
public static void TestVehicleKits()
{
var kitIndex = NativeFunction.Natives.GET_VEHICLE_MOD_KIT<int>(Game.LocalPlayer.Character.CurrentVehicle);
if (gVehicleModelInfoVarGlobal == null)
{
var addr = Game.FindPattern("48 8B 0D ?? ?? ?? ?? 44 8B C6 8B D5 8B D8");
gVehicleModelInfoVarGlobal = (CVehicleModelInfoVarGlobal**)(addr + *(int*)(addr + 3) + 7);
template matchingOverload(alias funcSymbol, Args...)
{
private template parametersMatch(alias funcSymbol, T...)
{
import std.traits : Parameters;
enum parametersMatch = is(Parameters!funcSymbol == T);
}
static foreach(s; __traits(getOverloads, __traits(parent, funcSymbol), __traits(identifier, funcSymbol)))
{
@alexguirre
alexguirre / Particles Effects Dump.txt
Last active October 27, 2024 23:55
GTA V Particle Effects Dump
# Thanks to CodeWalker for the code to read .ypt files: https://github.com/dexyfex/CodeWalker
#
# Format:
# [asset_name]
# effect_name_1
# effect_name_2
#
[core]
bul_gravel_heli
// Generated by GTA V Euphoria Behaviours Parser v1.2.0.0 by alexguirre
namespace Rage.Euphoria
{
using Rage;
using Rage.Euphoria;
using Rage.Attributes;
/// <summary>
///
/// </summary>
internal static class DamagePack
{
public static void ApplyDamagePack(this Ped ped, string damagePackName, float damage, float multiplier)
{
NativeFunction.Natives.ApplyPedDamagePack(ped, damagePackName, damage, multiplier);
}
public const string BigHitByVehicle = "BigHitByVehicle";
public const string SCR_Dumpster = "SCR_Dumpster";
public const string SCR_Torture = "SCR_Torture";
// System
using System.Drawing;
// RPH
using Rage;
using Rage.Native;
internal class LoopedParticle : IHandleable
{
public string AssetName { get; }
// System
using System.Drawing;
// RPH
using Rage;
using Rage.Native;
internal class Decal
{
public uint Handle { get; }
internal enum WeaponHashEx : uint
{
Unarmed = 2725352035,
Animal = 4194021054,
Cougar = 148160082,
Knife = 2578778090,
Nightstick = 1737195953,
Hammer = 1317494643,
Bat = 2508868239,
GolfClub = 1141786504,