Skip to content

Instantly share code, notes, and snippets.

@Rasinzz
Rasinzz / snippet.json
Created July 24, 2024 07:39
VSCode React Functional Component Export Snippet
{
"Functional Component Export": {
"prefix": "fce",
"body": [
"const $1 = () => {",
" return <div>$1</div>;",
"};",
"",
"export default $1;"
]
@Rasinzz
Rasinzz / guide.md
Last active July 24, 2024 04:12
NPM Format All Files Using Prettier

Guide to automatically format all files using an NPM script

Install Prettier

npm install --save-dev prettier

Create .prettierrc File

{
@Rasinzz
Rasinzz / dv.lua
Created June 12, 2022 15:28
FiveM delete vehicle
RegisterCommand('dv', function()
local ped = PlayerPedId()
local veh = GetVehiclePedIsIn(ped, false)
SetEntityAsMissionEntity(veh, true, true)
DeleteVehicle(veh)
end)
@Rasinzz
Rasinzz / upgrade.lua
Last active June 12, 2022 20:07
FiveM upgrade vehicle
RegisterCommand('upgrade', function()
local ped = PlayerPedId()
local vehicle = GetVehiclePedIsIn(ped, false)
local modTypes = {11, 12, 13, 15, 16}
SetVehicleModKit(vehicle, 0) -- must call to apply mods
for _, modType in ipairs(modTypes) do
local maxMod = GetNumVehicleMods(vehicle, modType) - 1
SetVehicleMod(vehicle, modType, maxMod, false)
@Rasinzz
Rasinzz / serverId.lua
Created October 5, 2021 17:12
FiveM Get Player Server ID (client-side)
RegisterCommand('serverId', function()
print(GetPlayerServerId(PlayerId()))
end, false)
@Rasinzz
Rasinzz / run.cmd
Last active May 21, 2023 23:18
FiveM run.cmd
@echo off
%~dp0\..\server\FXServer.exe +exec server.cfg
@REM Delete Server Cache
@REM @echo off
@REM :choice
@REM set /P c=Would you like to delete the server cache? [Y/N]
@REM if /I "%c%" EQU "Y" goto :delete_cache
@REM if /I "%c%" EQU "N" goto :start_server