Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. addEventHandler("onPlayerMoveItemInInventoryFast", root, function(itemName, loot, value)
  2. local itemPlus = value;
  3. if (itemName == "M1911 Mag") then itemPlus = 10*value;
  4. elseif (itemName == "M9 SD Mag") then itemPlus = 15*value;
  5. elseif (itemName == "Desert Eagle Mag") then itemPlus = 7*value;
  6. elseif (itemName == "PDW Mag") then itemPlus = 30*value;
  7. elseif (itemName == "MP5A5 Mag") then itemPlus = 20*value;
  8. elseif (itemName == "AS50 Mag") then itemPlus = 10*value;
  9. elseif (itemName == "CZ550 Mag") then itemPlus = 10*value;
  10. elseif (itemName == "Mosin 9130 Mag") then itemPlus = 35*value;
  11. elseif (itemName == "M24 Mag") then itemPlus = 10*value;
  12. elseif (itemName == "KVSK Mag") then itemPlus = 15*value;
  13. elseif (itemName == "M107 Mag") then itemPlus = 5*value;
  14. elseif (itemName == "SVD Dragunov Camo Mag") then itemPlus = 25*value;
  15. elseif (itemName == "MK 48 Mod 0 Mag") then itemPlus = 100*value;
  16. elseif (itemName == "MG36 Mag") then itemPlus = 100*value;
  17. elseif (itemName == "PKM Mag") then itemPlus = 100*value;
  18. elseif (itemName == "L85A2 Holo Mag") then itemPlus = 100*value;
  19. elseif (itemName == "AK-107 Mag") then itemPlus = 30*value;
  20. elseif (itemName == "FN SCAR-L Mag") then itemPlus = 30*value;
  21. elseif (itemName == "AKM Mag") then itemPlus = 30*value;
  22. elseif (itemName == "SA-58V ACOG Mag") then itemPlus = 30*value;
  23. elseif (itemName == "AKS-74U Mag") then itemPlus = 30*value;
  24. elseif (itemName == "M4A1 Tactical Mag") then itemPlus = 20*value;
  25. elseif (itemName == "1866 Slug") then itemPlus = 7*value;
  26. elseif (itemName == "2Rnd. Slug") then itemPlus = 2*value;
  27. elseif (itemName == "SPAZ-12 Pellet") then itemPlus = 7*value;
  28. elseif (itemName == "DMR Mag") then itemPlus = 5*value;
  29. elseif (itemName == "SKS-45 Mag") then itemPlus = 10*value;
  30. end
  31. if loot then
  32. local players = getElementsWithinColShape (loot,"player")
  33. if #players > 1 then
  34. triggerServerEvent("onPlayerChangeLoot",getRootElement(),loot)
  35. triggerEvent("gs_notification_text",getLocalPlayer(),"error","You cant take items because other player is too close!")
  36. return
  37. end
  38. setElementData(getLocalPlayer(),itemName,(getElementData(getLocalPlayer(),itemName) or 0)+itemPlus)
  39. if itemPlus == 0 then
  40. setElementData(loot,itemName,getElementData(loot,itemName)-0)
  41. else
  42. setElementData(loot,itemName,getElementData(loot,itemName)-value)
  43. end
  44. end
  45. if getElementData(loot, "itemloot") then
  46. triggerServerEvent("refreshItemLoot", getRootElement(), loot, getElementData(loot, "parent"));
  47. end
  48. end);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement