Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cl init
- local FirstJoinProper = false
- -- Load client at 100%
- Citizen.CreateThread(function()
- while true do
- Citizen.Wait(0)
- if NetworkIsSessionStarted() then
- if not FirstJoinProper then
- -- Send menu to Menu Generator
- exports.ft_menuBuilder:Generator(menu)
- end
- -- Press F1
- if IsControlJustPressed(1, 288) and GetLastInputMethod(2) then
- if not exports.ft_menuBuilder:IsOpened() then
- exports.ft_menuBuilder:Open("parler")
- else
- exports.ft_menuBuilder:Close()
- end
- end
- FirstJoinProper = true
- end
- end
- end)
- config
- menu = {
- parler = {
- settings = {
- title = "Force de voix",
- menuTitle = "Force de voix",
- },
- buttons = {
- { text = "Chuchoter", eventClient = "pv:voip", data = { voipDistance = "chuchoter" } },
- { text = "Parler", eventClient = "pv:voip", data = { voipDistance = "parler" } },
- { text = "Crier", eventClient = "pv:voip", data = { voipDistance = "crier" } },
- { text = "Close menu", close = true },
- },
- },
- }
- fonction
- local voip = {}
- voip['Parler'] = {name = 'Parler', setting = 15.0}
- voip['Chuchoter'] = {name = 'Chuchoter', setting = 2.0}
- voip['Crier'] = {name = 'Crier', setting = 25.0}
- RegisterNetEvent('pv:voip')
- AddEventHandler('pv:voip', function(data)
- if voip[data.voipDistance]then
- distanceName = [data.voipDistance].name
- distanceSetting = [data.voipDistance].setting
- else
- distanceName = voip['Parler'].name
- distanceSetting = voip['Parler'].setting
- end
- NotificationMessage("vous parler maintenant ~b~" .. distanceName ..".")
- NetworkSetTalkerProximity(distanceSetting)
- end)
- function NotificationMessage(message)
- SetNotificationTextEntry("STRING")
- AddTextComponentString(message)
- DrawNotification(0,1)
- end
- ressource
- resource_manifest_version '77731fab-63ca-442c-a67b-abc70f28dfa5'
- dependency 'ft_menuBuilder'
- -- Scripts
- client_scripts {
- "config.lua",
- "cl_init.lua",
- "cl_functions.lua",
- }
- server_scripts {
- }
Advertisement
Add Comment
Please, Sign In to add comment