😡
RAINMAD Documentation
WebsiteStoreDiscordYouTube
  • Welcome to RAINMAD Scripts
  • INFORMATION
    • FAQ
    • Support and Assistance
    • Discord Roles
    • How to Update Your Asset
  • CFX Auth system
    • FiveM Asset Escrow System
  • Development Guide
    • Common Issues
    • How to Add Webhooks
    • Target Options Configuration
    • How to Translate Your Script
    • How to Integrate Your Custom Notification Script
    • How to Change the Black Money Name
    • How to Add an Item
    • How to Change the Dispatch
    • Framework Selection and Configuration
    • Finding Item Images
  • RESOURCES
    • Cargo Ship Heist
      • Installation
      • Dependencies
      • Translate Strings
      • Discord Log
      • Configuration
      • Exports
    • Below the Vault Heist
      • Installation
    • NPC Mechanic
      • Installation
      • Configuration Guide
    • Cash Exchange Heist
      • Installation
      • Dependencies
    • Drugs V: Grow, Cook & Space!
      • Installation
      • Configuration Guide
    • Drugs V: Laboratories
      • Installation
      • Configuration Guide
    • Drugs V: Goods Deal
      • Installation
      • Configuration Guide
    • Drugs V: Business Labs
      • Installation
      • Configuration Guide
    • Drugs V: Effects
      • Installation
      • Configuration Guide
      • Exports
    • Drugs V: Money Laundering
      • Installation
      • Configuration Guide
    • Bank Truck Robbery - 4 in 1!
      • Installation
      • Dependencies
      • Translate Strings
      • Discord Log
      • Events & Exports
      • Disable Mission NPC
    • House Robbery with Welding Minigame
      • Installation
      • Dependencies
      • Inventory Integration
      • Translate Strings
      • Discord Log
      • Creating a House for Robbery
      • Events & Exports
      • Disable Mission NPC
    • Lootbag
      • Installation
    • Bounty Board
      • Installation
    • Chopshop with Welding Minigame
      • Installation
      • Dependencies
      • Translate Strings
      • Discord Log
      • Events & Exports
      • Disable Mission NPC
    • Scenes: Draw everywhere
      • Installation
      • Add Text Font
      • Events & Exports
    • Vault Heist
      • Installation
      • Vehicle Mods
      • Dependencies
    • Barge Heist
      • Installation
      • Dependencies
    • Towtruck + Missions
      • Installation
    • Zombies & Dungeon
      • Installation
      • Rarity System
    • Gangs - Territory, Wars & Tribute Zones!
      • Installation
      • Add Gang & Tribute Zone
      • Events & Exports
      • Gang System for ESX
    • Camper V: Drug Caravans
      • Installation
      • Dependencies
    • Realistic Airdrop
      • Installation
    • ATM Robbery - 4 in 1!
      • Installation
    • Bobcat Security Heist
      • Installation
      • Dependencies
    • Minigame Bundle
      • Installation
      • Minigame Exports
      • Translate Strings
    • Weapon V: Realism
      • Installation
    • Boombox with Watch Party
      • Installation
      • Youtube API Key
      • Exports
    • Drop and Dead Info.
      • Installation
    • Throw Everything
      • Installation
      • Useable Items
      • Exports
      • QBCore Compatibility
      • ESX Compatibility
    • Police Riot with Interior
      • Installation
      • Dependencies
    • Dialog with NPC
      • Installation
    • Gun Store Heist
      • Installation
      • Dependencies
    • Emoji V: Share Feelings
      • Installation
    • Illegal Corners: Selling Goods
      • Installation
      • Adding a New Corner
    • Decal V: Graffiti & Vehicle Sticker
      • Installation
      • Custom Decal
      • Events & Exports
    • Hacker V: Become Hacker
      • Installation
      • Custom Hack
      • Functions & Events
    • Weed Shop Heist
      • Installation
      • Dependencies
    • Jailbreak
      • Installation
      • Dependencies
    • Vangelico Heist Final
      • Installation
      • Dependencies
    • Pets
      • Installation
      • QBCore Compatible
    • Artifact Heist
      • Installation
    • Betta Heist
      • Installation
    • Oil Rig Heist
      • Installation
      • Dependencies
    • Fleeca Heist Final
      • Installation
      • Dependencies
    • Deluxe Car Heist
      • Installation
    • Yacht Heist
      • Installation
    • Paleto Heist
      • Installation
    • Union Heist
      • Installation
    • Shop Robbery
      • Installation
    • Drug Boat Heist
      • Installation
    • Underground Heist
      • Installation
      • Dependencies
    • Van Heist
      • Installation
      • Dependencies
    • Pacific Heist
      • Installation
      • Dependencies
    • Train Heist
      • Installation
    • Humane Labs Heist
      • Installation
    • Vangelico Heist
      • Installation
    • Fleeca Heist
      • Installation
    • Casino Heist
      • Installation
      • Dependencies
      • Compatible For Rcore
    • Art Heist
      • Installation
      • Dependencies
    • Kidnapping
      • Installation
    • Graffiti War
      • Installation
Powered by GitBook
On this page
  • Config (shared/cfg.lua)
  • Custom hack (client/custom_hack.lua)
  1. RESOURCES
  2. Hacker V: Become Hacker

Custom Hack

On this page, I'll give you snippets on how to add custom hack to Hacker V.

Config (shared/cfg.lua)

In this file, find the following lines and uncomment them. You can use this in every custom hack you add.

['custom_hack'] = {
    ['objects'] = {'prop_bin_01a'},
    ['offset'] = vector3(-0.25, -0.8, 0.25),
    ['label'] = '[E] Hack the garbage',
    ['icon'] = 'fa-solid fa-terminal',
    ['event'] = 'hackermod:client:hackGarbage', ['eventType'] = 'client',
    ['canInteract'] = function(entity)
        return not interactableObjects['custom_hack'][GetEntityCoords(entity)]
    end,
    ['cooldown'] = 0,
    ['requiredBotnet'] = 0,
},

These lines, add a new option to hack interactions. This table should be under cfg['interactions']. You can change orderly,

  • Which objects you want to be hacked

  • UI attach offset

  • UI label

  • UI icon

  • Event and type to be triggered

  • Can interact function

  • Hack cooldown

  • Required count of botnets.

Custom hack (client/custom_hack.lua)

In this file, you can create event for custom hack you added. I will explain it to you with an example case for you to understand the logic.

RegisterNetEvent('hackermod:client:hackGarbage', function(type, entity)
    Citizen.CreateThread(function()
        triggerCallback('hackermod:server:checkAction', function(status)
            if status then
                TriggerServerEvent('hackermod:server:sync', 'interactableObject', {type, GetEntityCoords(entity)})
                keepAnimTask = true
                DrawBusySpinner('Connecting to garbage', 5)
                local minigame = Minigame(3, 3)
                if minigame then
                    local randomMoney = math.random(100, 500)
                    TriggerServerEvent('hackermod:server:cash', randomMoney)
                    print('you won')
                else
                    TriggerServerEvent('hackermod:server:sync', 'interactableObject', {type, GetEntityCoords(entity)})
                    print('you failed')
                end
                keepAnimTask = false
            end
        end, type)
    end)
end)
  • When an event is triggered, the event function written to cfg comes with two parameters. type and entity. Type is hack type, entity is local entity ID.

  • We are creating a new thread so that it does not affect other loops in the script. (Citizen.CreateThread)

  • We check the cooldown of the action and the required count of botnets for the player. (triggerCallback)

  • We are disable the object for other players. (Other players will see "Already Hacked." text. (hackermod:server:sync', 'interactableObject')

  • We set this variable to 'true' so that the phone stays on your hand for the duration of the action. (keepAnimTask)

  • We create a 5 second wait for action. (DrawBusySpinner())

  • We create minigame for action. (Minigame())

  • If the minigame is completed successfully, the event that will give money to the player will be triggered, otherwise the object will be active again so that other players can hack it. (if-else block)

  • At the end of the action, we take the phone out of the player's view. (keepAnimTask)

PreviousInstallationNextFunctions & Events

Last updated 8 months ago