Skip to content

Instantly share code, notes, and snippets.

View CamxxCore's full-sized avatar
👨‍🚀
Focusing

Cam CamxxCore

👨‍🚀
Focusing
View GitHub Profile
@CamxxCore
CamxxCore / gist:d874e2facf85a0f911ba847f939abc9e
Last active July 1, 2023 18:00
Memory class the retrieve the name of a currently playing animation
using System;
using System.Linq;
using System.Runtime.InteropServices;
namespace Memory
{
public static class MemoryAccess
{
private delegate int GetAnimDictIndex(ref int index, int dictionaryHash);
void function IconForLootThread( entity player, entity loot, LootData lootData, array<var> itemRuis, var farRui ) {
EndSignal( player, "OnDestroy" )
EndSignal( player, "OnDeath" )
EndSignal( loot, "OnDestroy" )
Assert ( IsNewThread(), "Must be threaded off." )
if ( player != GetLocalClientPlayer() ) return
if ( GetCodeBool( "StreamingMode" ) ) return
if ( !IsValid( loot ) ) return
if ( lootData.lootType == eLootType.MAINWEAPON ) {
void function GimmeTheLootThread()
{
while ( true )
{
if ( GetConVarInt( "2" ) == 0 || !autoLootEnabled)
{
wait 5.0
continue
}
@CamxxCore
CamxxCore / gist:a0c49de27c0bd0a58e0216bb8b418c95
Created July 26, 2017 19:19
Class to display a chat box like multiplayer
using System;
using System.Windows.Forms;
using GTA;
using GTA.Native;
using Control = System.Windows.Forms.Control;
public delegate void UIChatMessageHandler(UIChat sender, string message);
public class UIChat : GTA.Script
{
#region SetupAfterburnerPatch
pattern = new Pattern("\x3C\x07\x0F\x84\x00\x00\x00\x00\x8B\x87\x00\x00\x00\x00", "xxxx????xx????");
result = pattern.Get(-155);
byte[] bytes = { 0xE9, 0x79, 0x01, 0x00, 0x00, 0x90 };
Marshal.Copy(bytes, 0, result, bytes.Length);
pattern = new Pattern("\x45\x33\xC9\x44\x8B\xC5\x48\x8B\xD3\x48\x8B\xCE", "xxxxxxxxxxxx");
result = pattern.Get(-5);
if (result == IntPtr.Zero) return;
byte[] byteArray = { 0x90, 0x90, 0x90, 0x90, 0x90 };
Marshal.Copy(byteArray, 0, result, byteArray.Length);
using System;
using System.Runtime.InteropServices;
using System.Text;
using System.Xml;
namespace Memory
{
public static unsafe class MemoryAccess
{
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
[StructLayout(LayoutKind.Explicit)]
public struct PtfxAssetStore
{
[FieldOffset(0x10)]
public int MaxItems; //0x10-0x14
[FieldOffset(0x18)]
[MarshalAs(UnmanagedType.LPStr)]
public string StoreName;
[FieldOffset(0x38)]
public IntPtr Items; //0x38
while (deleteQueue.Count > 0)
{
var item = deleteQueue.Dequeue();
OnFireList.Remove(item);
}
foreach (var item in OnFireList)
{
var vehicle = new Vehicle(item.Key);
if (!vehicle.IsOnFire)
{
item.Value.RemoveFire_SmokeEffects();
deleteQueue.Enqueue(item.Key);
}