ed
This commit is contained in:
parent
ad226c88a2
commit
8254b4913c
12 changed files with 145 additions and 0 deletions
67
resources/[carscripts]/mx_fixwiring/client/main.lua
Normal file
67
resources/[carscripts]/mx_fixwiring/client/main.lua
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
-- How to use
|
||||
-- CircuitGame('x', 'y', 'scale', 'tamanho do jogo em vmin', '1.ogg', function()
|
||||
-- run something
|
||||
-- end)
|
||||
|
||||
-- parameters
|
||||
-- x = position on screen
|
||||
-- y = position on screen
|
||||
-- scale = game size on screen in scale (Normally 1.0)
|
||||
-- sound_name = audio name + format (example 1.ogg)
|
||||
|
||||
-- example
|
||||
-- TriggerEvent("Mx::StartMinigameElectricCircuit", '50%', '92%', '1.0', '30vmin', '1.ogg', function()
|
||||
-- print("Oops, I hit the code and ran something")
|
||||
-- end)
|
||||
|
||||
-- /startgame 50% 50% 1.0 30vmin 1.ogg
|
||||
|
||||
CallBackFunction = nil
|
||||
|
||||
RegisterCommand('startgame', function(src, args, cmd)
|
||||
TriggerEvent("Mx::StartMinigameElectricCircuit", args[1], args[2], args[3], args[4], args[5], function()
|
||||
print(">>>>>> Success <<<<<<")
|
||||
end)
|
||||
end, false)
|
||||
|
||||
RegisterNetEvent('Mx::StartMinigameElectricCircuit')
|
||||
AddEventHandler('Mx::StartMinigameElectricCircuit', function(x, y, scale, size_game, sound_name, Callback)
|
||||
CircuitGame(x, y, scale, size_game, sound_name, Callback)
|
||||
end)
|
||||
|
||||
function CircuitGame(x, y, scale, size_game, sound_name, Callback)
|
||||
SetNuiFocus(true,true)
|
||||
SendNUIMessage({
|
||||
ui = 'ui',
|
||||
NuiOpen = true,
|
||||
x = x,
|
||||
y = y,
|
||||
scale = scale,
|
||||
size_game = size_game,
|
||||
sound_name = sound_name,
|
||||
name_resource = GetCurrentResourceName()
|
||||
})
|
||||
CallBackFunction = Callback
|
||||
end
|
||||
|
||||
RegisterNUICallback('electric_circuit_completed', function(data, cb)
|
||||
CallBackFunction()
|
||||
CloseNui()
|
||||
cb('ok')
|
||||
end)
|
||||
|
||||
RegisterNUICallback('CloseNui', function(data, cb)
|
||||
CloseNui()
|
||||
cb('ok')
|
||||
end)
|
||||
|
||||
function CloseNui()
|
||||
local ped = PlayerPedId()
|
||||
ClearPedTasks(ped)
|
||||
|
||||
SetNuiFocus(false, false)
|
||||
SendNUIMessage({
|
||||
ui = 'ui',
|
||||
NuiOpen = false,
|
||||
})
|
||||
end
|
||||
27
resources/[carscripts]/mx_fixwiring/fxmanifest.lua
Normal file
27
resources/[carscripts]/mx_fixwiring/fxmanifest.lua
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
fx_version 'cerulean'
|
||||
|
||||
game 'gta5'
|
||||
|
||||
description 'Mx Fix Wiring'
|
||||
|
||||
version '1.1'
|
||||
|
||||
ui_page 'html/index.html'
|
||||
|
||||
|
||||
server_scripts {
|
||||
'server/*'
|
||||
}
|
||||
|
||||
client_scripts {
|
||||
'client/*'
|
||||
}
|
||||
|
||||
files {
|
||||
'html/index.html',
|
||||
'html/css/*.css',
|
||||
'html/js/*.js',
|
||||
'html/img/*.png',
|
||||
'html/sound/*.ogg',
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
BIN
resources/[carscripts]/mx_fixwiring/html/favicon.ico
Normal file
BIN
resources/[carscripts]/mx_fixwiring/html/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
1
resources/[carscripts]/mx_fixwiring/html/index.html
Normal file
1
resources/[carscripts]/mx_fixwiring/html/index.html
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
resources/[carscripts]/mx_fixwiring/html/sound/1.ogg
Normal file
BIN
resources/[carscripts]/mx_fixwiring/html/sound/1.ogg
Normal file
Binary file not shown.
BIN
resources/[carscripts]/mx_fixwiring/html/sound/2.ogg
Normal file
BIN
resources/[carscripts]/mx_fixwiring/html/sound/2.ogg
Normal file
Binary file not shown.
0
resources/[carscripts]/mx_fixwiring/server/main.lua
Normal file
0
resources/[carscripts]/mx_fixwiring/server/main.lua
Normal file
Loading…
Add table
Add a link
Reference in a new issue