Skip to content

Instantly share code, notes, and snippets.

View VIRUXE's full-sized avatar

Flávio Pereira VIRUXE

View GitHub Profile
@VIRUXE
VIRUXE / walkshake.lua
Last active April 30, 2024 17:38
Add vibration to walking and vehicle burnouts in FiveM (GTA V)
CreateThread(function()
local isShaking = false
while true do
local playerPed = PlayerPedId()
local inVehicle = IsPedInAnyVehicle(playerPed, false)
-- Intense burnout vibration
if inVehicle and IsVehicleInBurnout(GetVehiclePedIsIn(playerPed, false)) then
if not isShaking then
@VIRUXE
VIRUXE / bot.php
Created May 6, 2024 17:06
Simple utility Discord bot, ran on DiscordPHP
<?php
use Discord\Discord;
use Discord\Parts\Channel\Message;
use Psr\Http\Message\ResponseInterface;
use React\EventLoop\Factory;
require __DIR__ . '/vendor/autoload.php';
$discord = new Discord([
'token' => 'ODUxMDU1Njc5OTgwNTY4NTc2.YLytXQ.vXIhW7iCr7ClrTGj2mjcTrqQHBQ', // Big Smoke
@VIRUXE
VIRUXE / gpci.go
Created May 6, 2024 23:04
SA-MP's GPCI function implementation in GO and PHP
// https://github.com/Renegade334/gpci-js/blob/master/src/index.ts
package main
import (
"crypto/sha1"
"encoding/binary"
"encoding/hex"
"fmt"
"os/user"
dpkg --add-architecture i386
apt update
https://stackoverflow.com/questions/61590804/how-to-install-gcc-9-on-debianlatest-docker
apt-get install libuuid1:i386
apt-get install libstdc++6:i386
uuid-dev:i386
@VIRUXE
VIRUXE / ac.pwn
Created May 7, 2024 00:41
Anti-cheat socket connection code for Scavenge and Survive
/*
AC client connects to GS through socket
Server stores IP and username in buffer
OnPlayerConnect -> check name/IP is in buffer
if so: query that IP for AC, get hardware info
Player = an in-game player who is connected to the game server
Client = anti-cheat client application connected to the server
*/
@VIRUXE
VIRUXE / vehicles.json
Created May 9, 2024 07:35
GTAV Vehicle Labels in Portuguese, using their internal name as keys. Organized by their respective categories.
{
"AMPHIBIOUS_QUADBIKE": {
"OFF_ROAD": {
"blazer5": "Blazer Aqua"
}
},
"SUBMARINECAR": {
"SPORT_CLASSIC": {
"stromberg": "Stromberg",
"toreador" : "Toreador"
@VIRUXE
VIRUXE / IMG.py
Last active May 14, 2024 22:33
Python class to handle IMG archives from old GTA games - not sure I finished or even tested it
import struct
from utils import *
class IMGArchive:
sectorsize = 2048
headersize = 8
dentrysize = 32
def __init__(self, filepath, callback=None):
self.filestream = open(filepath, 'rb')
@VIRUXE
VIRUXE / vehicleInfo-pt-br.full.json
Created May 9, 2024 08:24
Full GTAV vehicle info, extracted from the game, with pt-BR labels (January 2023)
This file has been truncated, but you can view the full file.
{
"1032823388": {
"hash": 1032823388,
"name": "ninef",
"displayName": "NINEF",
"localizedName": "9F",
"manufacturerName": "OBEY",
"localizedManufacturer": "Obey",
"vehicleClass": 6,
"vehicleClassName": "VEH_CLASS_6",
@VIRUXE
VIRUXE / InstallDotNet452.ps1
Last active June 12, 2024 16:08
Download and Install .NET Framework 4.5.2 (required for C# development on FiveM)
Write-Host "Downloading .NET Framework 4.5.2..."
$outputFile = "dotNetFramework452.exe"
Try {
Invoke-WebRequest -Uri "https://go.microsoft.com/fwlink/?linkid=397673&clcid=0x409" -OutFile $outputFile
If (Test-Path $outputFile) {
Write-Host "Download complete. Installing..."
Start-Process $outputFile -Args "/quiet /norestart" -Wait
Write-Host ".NET Framework 4.5.2 installed successfully."
} Else {
@VIRUXE
VIRUXE / locale-check.py
Created May 9, 2024 13:26
Checks missing and unused locale keys for a given language, used on the ESX framework (FiveM)
"""
Author: https://github.com/VIRUXE
This script is intended to scan actual script `.lua` files inside a FXServer (CFX/FiveM server) `resources` folder, looking for translation keys.
The ESX framework uses two functions called Translate and TranslateCap to retrieve translations from their respective locale files.
Once it finds all the keys used in the script files, it will scan the `pt.lua` file inside the `locales` folder.
In order to find out which keys are missing, it will compare the keys found in the script files with the keys found in the `pt.lua` file.
The script will then print the keys that are missing and/or unused from the `pt.lua` file