Skip to content

Instantly share code, notes, and snippets.

View Local9's full-sized avatar
💭
I may be slow to respond.

127.0.0.1 Local9

💭
I may be slow to respond.
  • Bristol/Cornwall
View GitHub Profile
@Local9
Local9 / nginx.conf
Created May 27, 2023 22:20
Example NGINX conf for Windows
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@Local9
Local9 / rave.lua
Last active May 18, 2024 05:29
Stupid thing made in FiveM (Warning, don't use if you suffer from epilepsy)
print("Loading light client.lua")
local lights = {
"h4_prop_battle_lights_fx_riga",
"h4_prop_battle_lights_fx_rigb",
"h4_prop_battle_lights_fx_rigc",
"h4_prop_battle_lights_fx_rigd",
"h4_prop_battle_lights_fx_rige",
"h4_prop_battle_lights_fx_rigf",
"h4_prop_battle_lights_fx_rigg",
--[[ INTERNAL FUNCTIONS ]]--
function getQueryOutfit(blob)
local lockHash = string.unpack('<i4', blob, 1)
local hash = string.unpack('<i4', blob, 9)
local price = string.unpack('<i4', blob, 17)
local unk1 = string.unpack('<i4', blob, 25)
local totalItems = string.unpack('<i4', blob, 33)
local unk2 = string.unpack('<i4', blob, 41)
local unk3 = string.unpack('<i4', blob, 49)
local gxt = string.unpack('z', blob, 57)
--[[ INTERNAL FUNCTIONS ]]--
function getQueryOutfit(blob)
local lockHash = string.unpack('<i4', blob, 1)
local hash = string.unpack('<i4', blob, 9)
local price = string.unpack('<i4', blob, 17)
local unk1 = string.unpack('<i4', blob, 25)
local totalItems = string.unpack('<i4', blob, 33)
local unk2 = string.unpack('<i4', blob, 41)
local unk3 = string.unpack('<i4', blob, 49)
local gxt = string.unpack('z', blob, 57)
@Local9
Local9 / DapperDatabase.cs
Last active March 23, 2023 07:31
Basic FiveM SQL Dapper which uses FxEvents Logger (Log class)
using Curiosity.Framework.Server.Models;
using Dapper;
using Logger; // FxEvents on NuGet
using MySqlConnector;
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
using System.Text;
using Debug = CitizenFX.Core.Debug;
SetToggleMinimapHeistIsland(true) -- Range check to enable/disable
LoadGlobalWaterType(1) -- Range check to enable/disable
SetAiGlobalPathNodesType(1) -- Range check to enable/disable (if changed too close to the island will crash
SetScenarioGroupEnabled("Heist_Island_Peds", true)
RequestIpl("h4_islandx_disc_StrandedWhale")
RequestIpl("h4_islandx_disc_StrandedShark")
RequestIpl("h4_islandairstrip")
@Local9
Local9 / outfits.cs
Last active September 5, 2022 22:57
Character Components
static int[][] GetCharacterOutfitSettings(bool isMale, int iParam1)
{
var components = new int[12];
var textures = new int[12];
for (int i = 0; i < 12; i++)
{
components[i] = -1;
textures[i] = -1;
}
@Local9
Local9 / fxmanifest.lua
Last active April 30, 2023 14:13
A Lua script to check resource version against GitHub releases
-- add the following metadata to your fxmanifest.lua
version 'v1.0.0'
repository 'https://github.com/<USER or ORGANISATION>/<REPOSITORY NAME>'
@Local9
Local9 / AddCommands.lua
Last active January 28, 2022 15:51
Add Commands Example
AddEventHandler("onClientResourceStart", function(resourceName)
if resourceName ~= GetCurrentResourceName() then
return;
end;
AddCommands();
end);
function AddCommands()
TriggerEvent("chat:addSuggestion", "/nc", "Toggle no clip", {});
TriggerEvent("chat:addSuggestion", "/rc", "reload clothes", {});
@Local9
Local9 / NuiWrapper.cs
Last active June 16, 2021 10:57 — forked from manups4e/NuiWrapper.cs
Nui Wrapper
public class NuiManager
{
private bool _hasFocus;
/// <summary>
/// true if focus is active.
/// </summary>
public bool IsNuiFocusOn => _hasFocus;
/// <summary>