function main()
while true do
if IsKeyJustPressed(VK_F9) then
local menu = {}
menu.title = "Mod Menu"
menu.options = {
{label = "Darte dinero", func = giveMoney},
{label = "Sacar auto", func = spawnVehicle},
{label = "Armas", func = giveWeapons},
{label = "Ropa", func = giveOutfit},
{label = "Regenerar vida", func = healPlayer},
}
createMenu(menu)
end
Wait(0)
end
end
function createMenu(menu)
local currentSelection = 1
local maxSelection = #menu.options
local menuOpen = true
while menuOpen do
ClearAllHelpMessages()
DrawMenuTitle(menu.title)
for i = 1, maxSelection do
local label = menu.options[i].label
if i == currentSelection then
label = "-> " .. label .. " <-"
end
DrawMenuOption(label)
end
if IsControlJustPressed(1, 177) then -- Backspace
menuOpen = false
elseif IsControlJustPressed(1, 172) then -- Up arrow
if currentSelection > 1 then
currentSelection = currentSelection - 1
else
currentSelection = maxSelection
end
elseif IsControlJustPressed(1, 173) then -- Down arrow
if currentSelection < maxSelection then
currentSelection = currentSelection + 1
else
currentSelection = 1
end
elseif IsControlJustPressed(1, 176) then -- Enter
local func = menu.options[currentSelection].func
func()
end
Wait(0)
end
end
function DrawMenuTitle(title)
SetTextFont(1)
SetTextProportional(0)
SetTextScale(0.0, 0.35)
SetTextColour(255, 255, 255, 255)
SetTextCentre(true)
SetTextDropShadow(0, 0, 0, 0, 255)
SetTextEdge(0, 0, 0, 0, 255)
SetTextEntry("STRING")
AddTextComponentString(title)
DrawText(0.5, 0.08)
end
function DrawMenuOption(text)
SetTextFont(1)
SetTextProportional(0)
SetTextScale(0.0, 0.35)
SetTextColour(255, 255, 255, 255)
SetTextCentre(true)
SetTextDropShadow(0, 0, 0, 0, 255)
SetTextEdge(0, 0, 0, 0, 255)
SetTextEntry("STRING")
AddTextComponentString(text)
DrawText(0.5, 0.2)
end
function giveMoney()
-- Código para dar dinero al jugador
end
function spawnVehicle()
-- Código para spawnear un vehículo al jugador
end
function giveWeapons()
-- Código para dar armas al jugador
end
function giveOutfit()
-- Código para cambiar la ropa del jugador
end
function healPlayer