Skip to content

Instantly share code, notes, and snippets.

View VIRUXE's full-sized avatar

Flávio Pereira VIRUXE

View GitHub Profile
@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 {
@ihyajb
ihyajb / carscaleform.lua
Created December 26, 2023 19:02
carscaleform.lua
--* idc if you use this in public / private script *--
--* But if you use *most / all* of my code credit would be nice 💖 *--
local MaxCars = 20 --Max is a HARD CAP OF 20, only make this number lower!
local function func_7050(string)
local scaleform = RequestScaleformMovie(string)
repeat
Wait(100)
until HasScaleformMovieLoaded(scaleform)
return scaleform
@tabarra
tabarra / README.md
Created April 19, 2023 06:52
Listing FiveM/GTA5 vehicle model classes/types that diverge.

If you need to spawn a vehicle on the server side, you can use CreateVehicleServerSetter(), but the issue is that you need the vehicle type, but on the server there is no native to get it from a vehicle model.
In txAdmin this was initially "solved" by getting the vehicle class on the client and sending that to the server use it as a type when creating the vehicle. The logic used on the client is to check for the class on the vehClassNamesEnum table and assuming automobile for classes not on that table.

Later it was noticed that the server needs "type" instead of "class", and there is also no GetVehicleTypeFromName() on the client.
To solve this issue, it was created a lookup table to fix mismatched types.

This gist shows how to generate that table.
This must be run every now and then since new vehicles are added to the game on new DLC releases.

@userMacieG
userMacieG / engine.lua
Last active March 22, 2024 12:19
Turn engine on and off via key (ox_lib)
lib.onCache('ped', function(value)
SetPedConfigFlag(value, 241, true) -- PED_FLAG_DISABLE_STOPPING_VEHICLE_ENGINE
SetPedConfigFlag(value, 429, true) -- PED_FLAG_DISABLE_STARTING_VEHICLE_ENGINE
end)
lib.addKeybind({
name = 'engine',
description = 'Engine',
defaultKey = 'Y',
onPressed = function(self)
@xXTurnerLP
xXTurnerLP / tp.lua
Last active February 25, 2024 19:42
FiveM Precise waypoint teleport script. Always teleports at the top most level, so if you mark a building it will teleport to the top of that building (No permissions, client side)
RegisterCommand("tp", function(source, args, rawCommand)
local waypointBlip = GetFirstBlipInfoId(GetWaypointBlipEnumId())
local blipPos = GetBlipInfoIdCoord(waypointBlip) -- GetGpsWaypointRouteEnd(false, 0, 0)
local z = GetHeightmapTopZForPosition(blipPos.x, blipPos.y)
local _, gz = GetGroundZFor_3dCoord(blipPos.x, blipPos.y, z, true)
SetEntityCoords(PlayerPedId(), blipPos.x, blipPos.y, z, true, false, false, false)
FreezeEntityPosition(PlayerPedId(), true)
@tabarra
tabarra / admins.json
Last active September 27, 2024 04:47
Temporary admins file for txAdmin, please add it to txData/admins.json. The password is masterpassword123.
[
{
"name": "txmaster",
"master": true,
"password_temporary": true,
"password_hash": "$2a$12$JterWfFQx1abyi.OBKTIW.mOiHl7wrlyaTnz21SmygI20qO2xIdu2",
"providers": {},
"permissions": []
}
]
local scopes = {}
AddEventHandler("playerEnteredScope", function(data)
local playerEntering, player = data["player"], data["for"]
if not scopes[player] then
scopes[player] = {}
end
scopes[player][playerEntering] = true
@StubbornlyDesigned
StubbornlyDesigned / facebook-mass-delete-group-members.js
Last active February 22, 2016 04:04 — forked from mayukojpn/facebook-mass-delete-group-members.js
This script goes through and removes all members from a Facebook group. Replace the ID in the second line with your own Facebook ID!!! Then navigate to the members tab of your group and copy/paste the entire code into the javascript console. Script tested in Chrome. Removes 10 members a minute!
var deleteAllGroupMembers = (function () {
var excludedFbIds = ['100005315525880']; /*########## Replace number between single quotes with your own Facebook ID. DO NOT REMOVE THE SINGLE QUOTES! ##########*/
var deleteAllGroupMembers = {};
var usersToDeleteQueue = [];
var scriptEnabled = false;
var processing = false;
var memberCount = document.getElementsByClassName('_5bv4')[0].lastChild;
deleteAllGroupMembers.start = function() {
@robrotheram
robrotheram / migrate.php
Last active January 11, 2017 19:19
migrate for flaurm version 0.2 and 0.3
<?php
// Configs for phpbb database
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "phpbbDatabase";
$fileName = "flaurm.sql";
$phpprefix = "phpbb_";
//Sets the inital id for the new users posts and discussions set if you know you have more then 1000 users change.
$id = 1000;
@rafa-munoz
rafa-munoz / Delete all facebook members (all the one visible on a given page)
Last active March 10, 2018 13:24 — forked from nirgeier/Delete all facebook members (all the one visible on a given page)
Delete all facebook group members on a given page. Usage: Copy this script, open developers console (F12) in chrome (win) and paste this script. The window will reload when it's finished
/**
* This script will remove all group members displayed.
*
* @author: Nir Geier
*
* Usage:
* Load as many users as you need, then open console and paste this script in the
* console.
*
* Once the script finished executing, the page will autoreload.