📦Installation
1. Add Interaction Type to Core Game
Add the following entry to:
core_game > config.lua > Config.InteractionTypes
This defines the interaction logic for server racks.
['cryptominer'] = {
PromptName = 'Server Rack',
PromptDescription = 'I\'m way outta my depth...',
PromptIcon = 'fa-solid fa-server',
PromptComplete = function(objConf, obj)
TaskTurnPedToFaceEntity(playerPedId, obj, 2000, 0.0, 0.0, 0.0) -- Dont set duration to infinite
Citizen.Wait(250)
TriggerEvent('client:cryptomining:getminer', source)
end,
Object = `v_corp_servercln`,
UseItemMetadata = true,
InteractDist = 1.3,
ReturnItem = 'serverrack',
StoreMetadataOnReturn = true,
Offset = vector4(0.0, 0.0, -1.0, 0.0),
LimitUse = false,
},2. Add Required Items to Core
Add these items to:
core > shared.gta5.lua
These define the server rack and GPU components.
["serverrack"] = {
["label"] = "Server Rack",
["weight"] = 30000,
["type"] = "item",
["image"] = "serverrack.webp",
["unique"] = true,
["stackable"] = true,
["useable"] = true,
["shouldClose"] = true,
["description"] = "I could build something cool with this..",
["metadata"] = {
balance = 0,
password = 0,
stashId = 0
}
},
["lowendgpu"] = {
["label"] = "Low-End GPU",
["weight"] = 500,
["type"] = "item",
["image"] = "lowendgpu.webp",
["unique"] = false,
["stackable"] = true,
["useable"] = false,
["shouldClose"] = false,
["description"] = "Budget performance..",
["decay"] = 1,
["decayRate"] = 101
},
["midrangegpu"] = {
["label"] = "Mid-Range GPU",
["weight"] = 500,
["type"] = "item",
["image"] = "highendgpu.webp",
["unique"] = false,
["stackable"] = true,
["useable"] = false,
["shouldClose"] = false,
["description"] = "Affordable performance..",
["decay"] = 1,
["decayRate"] = 101
},
["highendgpu"] = {
["label"] = "High-End GPU",
["weight"] = 500,
["type"] = "item",
["image"] = "highendgpu.webp",
["unique"] = false,
["stackable"] = true,
["useable"] = false,
["shouldClose"] = false,
["description"] = "Not so affordable performance..",
["decay"] = 1,
["decayRate"] = 101
},3. Add Radial Menu Entry
Add the following submenu under:
radialmenu > config.lua > newSubMenus
This allows players to pick up server racks through the radial menu.
['general:pickupServerRack'] = {
title = 'Pickup Server',
icon = 'server',
iconCategory = 'solid',
functionName = 'cryptomining:client:pickupClosestMiner',
enableMenu = function()
return not isDead and (exports['core_game']:CanPickupInteractionObject('cryptominer'))
end,
},Then add 'general:pickupServerRack' to the general rootMenuConfig list so it appears in the main radial menu.
4. Add Item Images
Place the following images into your inventory image folder:
serverrack.webplowendgpu.webphighendgpu.webp
Make sure the filenames match the image names defined in the core item config.
5. Start the Resource
Add to your server.cfg or resources.cfg:
ensure cryptomining6. Testing the System
Spawn or obtain a serverrack item.
Place it in the world using your core interaction system.
Interact with it to install GPU components.
Use the radial menu to pickup and move the rack.
If everything is correct, the cryptominer interaction will work and metadata will store balance, password, and stash ID.
Last updated
