LH_Lawliet

Untitled

Jun 15th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.13 KB | None | 0 0
  1. cl init
  2.  
  3. local FirstJoinProper = false
  4. -- Load client at 100%
  5. Citizen.CreateThread(function()
  6.  
  7.   while true do
  8.     Citizen.Wait(0)
  9.  
  10.     if NetworkIsSessionStarted() then
  11.  
  12.       if not FirstJoinProper then
  13.           -- Send menu to Menu Generator
  14.         exports.ft_menuBuilder:Generator(menu)
  15.       end
  16.  
  17.       -- Press F1
  18.       if IsControlJustPressed(1, 288) and GetLastInputMethod(2) then
  19.         if not exports.ft_menuBuilder:IsOpened() then
  20.           exports.ft_menuBuilder:Open("parler")
  21.         else
  22.           exports.ft_menuBuilder:Close()
  23.         end
  24.       end
  25.  
  26.       FirstJoinProper = true
  27.     end
  28.  
  29.   end
  30. end)
  31.  
  32.  
  33.  
  34. config
  35.  
  36.  
  37.  
  38.   menu = {
  39.  
  40.     parler = {
  41.  
  42.       settings = {
  43.         title = "Force de voix",
  44.         menuTitle = "Force de voix",
  45.       },
  46.  
  47.       buttons = {
  48.         { text = "Chuchoter", eventClient = "pv:voip", data = { voipDistance = "chuchoter" } },
  49.         { text = "Parler", eventClient = "pv:voip", data = { voipDistance = "parler" } },
  50.         { text = "Crier", eventClient = "pv:voip", data = { voipDistance = "crier" } },
  51.         { text = "Close menu", close = true },
  52.       },
  53.  
  54.     },
  55.  
  56.   }
  57.  
  58.  
  59.  
  60.  
  61. fonction
  62.  
  63.  
  64. local voip = {}
  65. voip['Parler'] = {name = 'Parler', setting = 15.0}
  66. voip['Chuchoter'] = {name = 'Chuchoter', setting = 2.0}
  67. voip['Crier'] = {name = 'Crier', setting = 25.0}
  68.  
  69.  
  70.     RegisterNetEvent('pv:voip')
  71. AddEventHandler('pv:voip', function(data)
  72.  
  73.     if voip[data.voipDistance]then
  74.         distanceName = [data.voipDistance].name
  75.         distanceSetting = [data.voipDistance].setting
  76.     else
  77.         distanceName = voip['Parler'].name
  78.         distanceSetting = voip['Parler'].setting
  79.     end
  80.    
  81.     NotificationMessage("vous parler maintenant ~b~" .. distanceName ..".")
  82.     NetworkSetTalkerProximity(distanceSetting)
  83.        
  84. end)
  85.  
  86. function NotificationMessage(message)
  87.     SetNotificationTextEntry("STRING")
  88.     AddTextComponentString(message)
  89.     DrawNotification(0,1)
  90. end
  91.  
  92.  
  93. ressource
  94.  
  95.  
  96. resource_manifest_version '77731fab-63ca-442c-a67b-abc70f28dfa5'
  97.  
  98. dependency 'ft_menuBuilder'
  99.  
  100. -- Scripts
  101. client_scripts {
  102.  
  103.   "config.lua",
  104.   "cl_init.lua",
  105.   "cl_functions.lua",
  106.  
  107. }
  108.  
  109. server_scripts {
  110.  
  111. }
Advertisement
Add Comment
Please, Sign In to add comment