This minigame is a twist on the classic 'Minesweeper', where players start with a set balance. Each safe move increases this balance, while uncovering a mine ends the game and reset the balance back to the initial starting amount. The goal is to maximize gains without hitting any mines and cashing out. A golden crown can be hit to receive a special reward item.
Feel free to star the repository and check out my store and discord @ Discord: https://discord.gg/samueldev & Store: https://fivem.samueldev.shop For support inquires please create a post in the support-forum channel on discord or create an issue here on Github.
![FiveM_b2944_GTAProcess_vF98r59f2y](https://private-user-images.githubusercontent.com/99494967/292765880-a4e9dc4b-a06e-4bf9-bd49-d10aaed867e3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI3NzgxMjQsIm5iZiI6MTcyMjc3NzgyNCwicGF0aCI6Ii85OTQ5NDk2Ny8yOTI3NjU4ODAtYTRlOWRjNGItYTA2ZS00YmY5LWJkNDktZDEwYWFlZDg2N2UzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA0VDEzMjM0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWViNDVhOTJiZDg0YmMxZWU4YjJhNjE2OTE1ZTZiZDc2OGQ2MGQ0ZmE4ZTJjYzU1ZjExYmYzNGVhYTFiZmJkNDAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.QbVwENiydZe2op_WnX7D8TLWMEkwXNflhnVPhIyUZc8)
![FiveM_b2944_GTAProcess_RzadbbyNcW](https://private-user-images.githubusercontent.com/99494967/292765884-bcb95cde-fb75-4992-bea3-02368bdae5bf.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI3NzgxMjQsIm5iZiI6MTcyMjc3NzgyNCwicGF0aCI6Ii85OTQ5NDk2Ny8yOTI3NjU4ODQtYmNiOTVjZGUtZmI3NS00OTkyLWJlYTMtMDIzNjhiZGFlNWJmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA0VDEzMjM0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTc3YzQ0Mzk5NGY0MTllOGY5M2Q4ZGNlY2VmYTRkOGMwZDFiNDc2ZjU0M2ExMTI0YWM2YTE2MmE2YmZkMTQ2M2YmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.LmQRqHxdEidcUtKIzzS7QAGJFd-wI5GW9rGhe9aaQiQ)
FiveM_b2944_GTAProcess_d3DQcUI9a5.mp4
- Clone or download this resource.
- Place it in the server's resource directory.
- Add the resource to your server config, if needed.
There's a couple neatly commented configs available in the sv_config.lua file.
This minigame features it's own money handling and logic, distinct from other minigames. Therefore, remove any existing money management code from scripts where this minigame is integrated, as demonstrated in the contextual example below.
You'll want to run the AddPlayer export and pass through source before running the minigame.
StartMineSweeper(title, iconClass, gridSize, startingBalance, multiplier, specialItem, timeoutDuration)
title
: Title of the minigame (e.g., "Minesweeper Challenge").iconClass
: CSS class for the icons used in the game grid (e.g., "fa-solid fa-gem").gridSize
: Size of the game grid (e.g.,5
for a 5x5 grid). (The minimum is 3 and the maximum is 8)startingBalance
: The initial balance or score at the start of the game.multiplier
: The multiplier applied to the balance upon uncovering a safe tile.specialItem
: The item rewarded upon revealing a golden tile.timeoutDuration
: Duration (in milliseconds) before the game automatically ends.
Both specialItem and timeoutDuration are optional parameters. If timeoutDuration is omitted, the game will not impose any time limit to complete the objective. On the other hand, if specialItem is not specified, the golden crown tile will function as a 1.5x multiplier instead.
Exclusively available on the server.
AddPlayer
: A security function that registers a player in the Minesweeper game, safeguarding against exploiters. It links their server and in-game IDs for accurate activity tracking.
This event should only be used on the server.
sd-minesweeper:client:start
: Initiates the Minesweeper game with specified parameters (eg. StartMineSweeper
).
-- Add player to to server-side table.
exports['sd-minesweeper']:AddPlayer(source)
-- Start the Minesweeper game
TriggerClientEvent('sd-minesweeper:client:start', source, 'Minesweeper Challenge', 'fa-solid fa-gem', 5, 1000, 1.2, 'diamond', 20000)
Straight from lation_247robbery <3
RegisterNetEvent('lation_247robbery:RewardRobbery', function(source, type)
local source = source
local player = GetPlayer(source)
if not player then return end
local playerName = GetName(source)
local identifier = GetIdentifier(source)
local distance = CheckPlayerDistance(source)
local item, quantity, value
if distance then
if type == 'register' then
item = Config.RegisterRewardItem
quantity = Config.RegisterRewardQuantity
if Config.RegisterRewardRandom then
quantity = math.random(Config.RegisterRewardMinQuantity, Config.RegisterRewardMaxQuantity)
end
value = quantity
exports['sd-minesweeper']:AddPlayer(source)
TriggerClientEvent('sd-minesweeper:client:start', source, 'Register Balance', 'fas fa-shopping-cart', 6, quantity, 1.05, 'laptop', 20000)
Wait(10000)
RegisterCooldown()
else
item = Config.SafeRewardItem
quantity = Config.SafeRewardQuantity
if Config.SafeRewardRandom then
quantity = math.random(Config.SafeRewardMinQuantity, Config.SafeRewardMaxQuantity)
end
value = quantity
SafeCooldown()
end
if Framework == 'qb' then
if Config.Metadata then
quantity = {worth = quantity}
value = quantity.worth
end
end
-- AddItem(source, item, quantity)
if Config.EnableLogs then
local robType = type:gsub("^%l", string.upper) -- Capitalizing string for logs
DiscordLogs(
'💰 ' ..robType.. ' ' ..Strings.Logs.titles.robbery,
Strings.Logs.labels.name ..playerName..
Strings.Logs.labels.id ..tostring(source)..
Strings.Logs.labels.identifier ..tostring(identifier)..
Strings.Logs.labels.message ..Strings.Logs.messages.robbery.. '$' ..GroupDigits(value).. ' ' ..item,
Strings.Logs.colors.green
)
end
end
end)