Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍🚀
Focusing

Cam CamxxCore

👨‍🚀
Focusing
View GitHub Profile
@CamxxCore
CamxxCore / gist:a0c49de27c0bd0a58e0216bb8b418c95
Created Jul 26, 2017
Class to display a chat box like multiplayer
View gist:a0c49de27c0bd0a58e0216bb8b418c95
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
{
@CamxxCore
CamxxCore / gist:d874e2facf85a0f911ba847f939abc9e
Last active Jul 3, 2021
Memory class the retrieve the name of a currently playing animation
View gist:d874e2facf85a0f911ba847f939abc9e
using System;
using System.Linq;
using System.Runtime.InteropServices;
namespace Memory
{
public static class MemoryAccess
{
private delegate int GetAnimDictIndex(ref int index, int dictionaryHash);
View gist:576b97d64e7f3aeb1202cd63c35158fe
#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);
View gist:25739bb281ebf0d7021e87f7d49a8f89
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);
View gist:3c81920f4ab30e5659310bd580268aae
using System;
using System.Runtime.InteropServices;
using System.Text;
using System.Xml;
namespace Memory
{
public static unsafe class MemoryAccess
{
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
View gist:38591de5b89088883478f09e82f0c924
[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
View gist:198a54be86d452a66ec835a79d2b6159
while (deleteQueue.Count > 0)
{
var item = deleteQueue.Dequeue();
OnFireList.Remove(item);
}
View gist:afc2d389bc840377feceb79617c90453
foreach (var item in OnFireList)
{
var vehicle = new Vehicle(item.Key);
if (!vehicle.IsOnFire)
{
item.Value.RemoveFire_SmokeEffects();
deleteQueue.Enqueue(item.Key);
}
View gist:e97201abeb433fd249cc0c140324928f
for (int i = VehiclePool.Length - 1; i >= 0; i--)
{
Vehicle veh = VehiclePool[i];
if (veh.IsOnFire && !OnFireList.ContainsKey(veh.Handle))
{
var fx = new VehicleEffects(veh);
fx.InitializeFire_SmokeEffect();
OnFireList.Add(veh.Handle, vehicleEffect);