Ethanos

[eden_accesories] - Add client Extended Clip

Aug 3rd, 2020 (edited)
1,761
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 13.93 KB | None | 0 0
  1. local used5 = 0
  2.  
  3. RegisterNetEvent('eden_accesories:chargeur')
  4. AddEventHandler('eden_accesories:chargeur', function(duration)
  5.     local inventory = ESX.GetPlayerData().inventory
  6.     local chargeur = 0
  7.         for i=1, #inventory, 1 do
  8.           if inventory[i].name == 'chargeur' then
  9.             chargeur = inventory[i].count
  10.           end
  11.         end
  12.  
  13. local ped = PlayerPedId()
  14. local currentWeaponHash = GetSelectedPedWeapon(ped)
  15.  
  16.         if used5 < chargeur then
  17.             if currentWeaponHash == GetHashKey("WEAPON_PISTOL") then
  18.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_PISTOL"), GetHashKey("COMPONENT_PISTOL_CLIP_02"))  
  19.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  20.                         used3 = used3 + 1
  21.  
  22.             elseif currentWeaponHash == GetHashKey("WEAPON_COMBATPISTOL") then
  23.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_COMBATPISTOL"), GetHashKey("COMPONENT_COMBATPISTOL_CLIP_02"))  
  24.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  25.     used5 = used5 + 1
  26.  
  27.             elseif currentWeaponHash == GetHashKey("WEAPON_APPISTOL") then
  28.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_APPISTOL"), GetHashKey("COMPONENT_APPISTOL_CLIP_02"))  
  29.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  30.     used5 = used5 + 1
  31.  
  32.             elseif currentWeaponHash == GetHashKey("WEAPON_PISTOL50") then
  33.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_PISTOL50"), GetHashKey("COMPONENT_PISTOL50_CLIP_02"))  
  34.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  35.     used5 = used5 + 1
  36.  
  37.             elseif currentWeaponHash == GetHashKey("WEAPON_SNSPISTOL") then
  38.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_SNSPISTOL"), GetHashKey("COMPONENT_SNSPISTOL_CLIP_02"))  
  39.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  40.     used5 = used5 + 1
  41.  
  42.             elseif currentWeaponHash == GetHashKey("WEAPON_HEAVYPISTOL") then
  43.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_HEAVYPISTOL"), GetHashKey("COMPONENT_HEAVYPISTOL_CLIP_02"))  
  44.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  45.     used5 = used5 + 1
  46.  
  47.             elseif currentWeaponHash == GetHashKey("WEAPON_SNSPISTOL_MK2") then
  48.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_SNSPISTOL_MK2"), GetHashKey("COMPONENT_SNSPISTOL_MK2_CLIP_02"))  
  49.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  50.     used5 = used5 + 1
  51.  
  52.             elseif currentWeaponHash == GetHashKey("WEAPON_PISTOL_MK2") then
  53.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_PISTOL_MK2"), GetHashKey("COMPONENT_PISTOL_MK2_CLIP_02"))  
  54.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  55.     used5 = used5 + 1
  56.  
  57.             elseif currentWeaponHash == GetHashKey("WEAPON_VINTAGEPISTOL") then
  58.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_VINTAGEPISTOL"), GetHashKey("COMPONENT_VINTAGEPISTOL_CLIP_02"))  
  59.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  60.     used5 = used5 + 1
  61.  
  62.             elseif currentWeaponHash == GetHashKey("WEAPON_CERAMICPISTOL") then
  63.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_CERAMICPISTOL"), GetHashKey("COMPONENT_CERAMICPISTOL_CLIP_02"))  
  64.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  65.     used5 = used5 + 1
  66.  
  67.             elseif currentWeaponHash == GetHashKey("WEAPON_MICROSMG") then
  68.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_MICROSMG"), GetHashKey("COMPONENT_MICROSMG_CLIP_02"))  
  69.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  70.     used5 = used5 + 1
  71.  
  72.             elseif currentWeaponHash == GetHashKey("WEAPON_SMG") then
  73.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_SMG"), GetHashKey("COMPONENT_SMG_CLIP_02"))  
  74.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  75.     used5 = used5 + 1
  76.  
  77.             elseif currentWeaponHash == GetHashKey("WEAPON_ASSAULTSMG") then
  78.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_ASSAULTSMG"), GetHashKey("COMPONENT_ASSAULTSMG_CLIP_02"))  
  79.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  80.     used5 = used5 + 1
  81.  
  82.             elseif currentWeaponHash == GetHashKey("WEAPON_MINISMG") then
  83.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_MINISMG"), GetHashKey("COMPONENT_MINISMG_CLIP_02"))  
  84.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  85.     used5 = used5 + 1
  86.  
  87.             elseif currentWeaponHash == GetHashKey("WEAPON_SMG_MK2") then
  88.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_SMG_MK2"), GetHashKey("COMPONENT_SMG_MK2_CLIP_02"))  
  89.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  90.     used5 = used5 + 1
  91.  
  92.             elseif currentWeaponHash == GetHashKey("WEAPON_MACHINEPISTOL") then
  93.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_MACHINEPISTOL"), GetHashKey("COMPONENT_MACHINEPISTOL_CLIP_02"))  
  94.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  95.     used5 = used5 + 1
  96.  
  97.             elseif currentWeaponHash == GetHashKey("WEAPON_COMBATPDW") then
  98.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_COMBATPDW"), GetHashKey("COMPONENT_COMBATPDW_CLIP_02"))  
  99.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  100.     used5 = used5 + 1
  101.  
  102.             elseif currentWeaponHash == GetHashKey("WEAPON_ASSAULTSHOTGUN") then
  103.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_ASSAULTSHOTGUN"), GetHashKey("COMPONENT_ASSAULTSHOTGUN_CLIP_02"))  
  104.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  105.     used5 = used5 + 1
  106.  
  107.             elseif currentWeaponHash == GetHashKey("WEAPON_HEAVYSHOTGUN") then
  108.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_HEAVYSHOTGUN"), GetHashKey("COMPONENT_HEAVYSHOTGUN_CLIP_02"))  
  109.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  110.     used5 = used5 + 1
  111.  
  112.             elseif currentWeaponHash == GetHashKey("WEAPON_ASSAULTRIFLE") then
  113.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_ASSAULTRIFLE"), GetHashKey("COMPONENT_ASSAULTRIFLE_CLIP_02"))  
  114.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  115.     used5 = used5 + 1
  116.  
  117.             elseif currentWeaponHash == GetHashKey("WEAPON_CARBINERIFLE") then
  118.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_CARBINERIFLE"), GetHashKey("COMPONENT_CARBINERIFLE_CLIP_02"))  
  119.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  120.     used5 = used5 + 1
  121.  
  122.             elseif currentWeaponHash == GetHashKey("WEAPON_ADVANCEDRIFLE") then
  123.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_ADVANCEDRIFLE"), GetHashKey("COMPONENT_ADVANCEDRIFLE_CLIP_02"))  
  124.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  125.     used5 = used5 + 1
  126.  
  127.             elseif currentWeaponHash == GetHashKey("WEAPON_SPECIALCARBINE") then
  128.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_SPECIALCARBINE"), GetHashKey("COMPONENT_SPECIALCARBINE_CLIP_02"))  
  129.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  130.     used5 = used5 + 1
  131.  
  132.             elseif currentWeaponHash == GetHashKey("WEAPON_BULLPUPRIFLE") then
  133.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_BULLPUPRIFLE"), GetHashKey("COMPONENT_BULLPUPRIFLE_CLIP_02"))  
  134.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  135.     used5 = used5 + 1
  136.  
  137.             elseif currentWeaponHash == GetHashKey("WEAPON_BULLPUPRIFLE_MK2") then
  138.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_BULLPUPRIFLE_MK2"), GetHashKey("COMPONENT_BULLPUPRIFLE_MK2_CLIP_02"))  
  139.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  140.     used5 = used5 + 1
  141.  
  142.             elseif currentWeaponHash == GetHashKey("WEAPON_SPECIALCARBINE_MK2") then
  143.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_SPECIALCARBINE_MK2"), GetHashKey("COMPONENT_SPECIALCARBINE_MK2_CLIP_02"))  
  144.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  145.     used5 = used5 + 1
  146.  
  147.             elseif currentWeaponHash == GetHashKey("WEAPON_ASSAULTRIFLE_MK2") then
  148.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_ASSAULTRIFLE_MK2"), GetHashKey("COMPONENT_ASSAULTRIFLE_MK2_CLIP_02"))  
  149.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  150.     used5 = used5 + 1
  151.  
  152.             elseif currentWeaponHash == GetHashKey("WEAPON_CARBINERIFLE_MK2") then
  153.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_CARBINERIFLE_MK2"), GetHashKey("COMPONENT_CARBINERIFLE_MK2_CLIP_02"))  
  154.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  155.     used5 = used5 + 1
  156.  
  157.             elseif currentWeaponHash == GetHashKey("WEAPON_COMPACTRIFLE") then
  158.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_COMPACTRIFLE"), GetHashKey("COMPONENT_COMPACTRIFLE_CLIP_02"))  
  159.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  160.     used5 = used5 + 1
  161.  
  162.             elseif currentWeaponHash == GetHashKey("WEAPON_MG") then
  163.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_MG"), GetHashKey("COMPONENT_MG_CLIP_02"))  
  164.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  165.     used5 = used5 + 1
  166.  
  167.             elseif currentWeaponHash == GetHashKey("WEAPON_COMBATMG") then
  168.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_COMBATMG"), GetHashKey("COMPONENT_COMBATMG_CLIP_02"))  
  169.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  170.     used5 = used5 + 1
  171.  
  172.             elseif currentWeaponHash == GetHashKey("WEAPON_COMBATMG_MK2") then
  173.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_COMBATMG_MK2"), GetHashKey("COMPONENT_COMBATMG_MK2_CLIP_02"))  
  174.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  175.     used5 = used5 + 1
  176.  
  177.             elseif currentWeaponHash == GetHashKey("WEAPON_GUSENBERG") then
  178.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_GUSENBERG"), GetHashKey("COMPONENT_GUSENBERG_CLIP_02"))  
  179.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  180.     used5 = used5 + 1
  181.  
  182.             elseif currentWeaponHash == GetHashKey("WEAPON_MARKSMANRIFLE_MK2") then
  183.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_MARKSMANRIFLE_MK2"), GetHashKey("COMPONENT_MARKSMANRIFLE_MK2_CLIP_02"))  
  184.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  185.     used5 = used5 + 1
  186.  
  187.             elseif currentWeaponHash == GetHashKey("WEAPON_HEAVYSNIPER_MK2") then
  188.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_HEAVYSNIPER_MK2"), GetHashKey("COMPONENT_HEAVYSNIPER_MK2_CLIP_02"))  
  189.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  190.     used5 = used5 + 1
  191.  
  192.             elseif currentWeaponHash == GetHashKey("WEAPON_MARKSMANRIFLE") then
  193.                  GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_MARKSMANRIFLE"), GetHashKey("COMPONENT_MARKSMANRIFLE_CLIP_02"))  
  194.                  ESX.ShowNotification(("Vous venez de vous équiper un chargeur grande capacité. Il devra être ~r~rééquiper~w~ à chaque retour en ville."))
  195.     used5 = used5 + 1
  196.  
  197.             else
  198.                   ESX.ShowNotification(("Vous n'avez pas d'arme en main ou votre arme ne peux pas supporter de poignée."))
  199.  
  200.             end
  201.         else
  202.                   ESX.ShowNotification(("Vous avez utiliser tous vos chargeurs."))
  203.         end
  204. end)
Advertisement
Add Comment
Please, Sign In to add comment