Skip to content

Instantly share code, notes, and snippets.

@snakewiz
snakewiz / peds.js
Created March 18, 2021 01:15
Script to scrape ped list from FiveM docs.
const puppeteer = require("puppeteer");
const fs = require("fs");
async function scrape() {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto("https://docs.fivem.net/docs/game-references/ped-models/");
@snakewiz
snakewiz / screen2world.lua
Last active March 27, 2025 03:28
Screen position to world position snippet, thanks to alex8b from gtaforums for the original code.
function world2Screen(pos)
local _, sX, sY = GetScreenCoordFromWorldCoord(pos.x, pos.y, pos.z)
return vector2(sX, sY)
end
function rotationToDirection(rotation)
local x = rotation.x * math.pi / 180.0
local z = rotation.z * math.pi / 180.0
local num = math.abs(math.cos(x))
return vector3((-math.sin(z) * num), (math.cos(z) * num), math.sin(x))