Nelsonnn

Untitled

Oct 21st, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.87 KB | None | 0 0
  1. weaponTable = {
  2.   -- WeapName,WeapAmmo,WeapID,AmmoMag,Type,ModelID,Damage,AmmoOcSlots,AmmoModelID,SpawnLocationPercent{Residential,Industrial,Farm,Supermarket,Military},Description
  3.   -- IDs disponíveis 1878-1882
  4.   {"M4","M4 Mag",31,20,1,2726,3500,0.035,1271,{0,0,0,0,0},"ItemDesc"},
  5.   {"CZ 550","CZ 550 Mag",34,5,1,2725,3500,0.035,1271,{0,0,0,0,0},"ItemDesc"},
  6.   {"Winchester 1866","1866 Slug",25,7,1,2644,3500,0.035,1271,{0,0,0,0,0.06},"ItemDesc"},
  7.   {"SPAZ-12 Combat Shotgun","SPAZ-12 Pellet",27,7,1,1950,2722,0.035,1271,{0,0,0,0,0.06},"ItemDesc"},
  8.   {"Sawn-Off Shotgun","2Rnd. Slug",26,2,1,1314,2722,0.035,1271,{0,0,0,0,1.02},"ItemDesc"},
  9.   {"AK-47","AK Mag",30,30,1,2832,3500,0.035,1271,{0,0,0,0,0},"ItemDesc"},
  10.   {"Lee Enfield","Lee Enfield Mag",33,10,1,2833,3500,0.035,1271,{0,0,0,0,0.03},"ItemDesc"},
  11.   {"M1911","M1911 Mag",22,7,1,2831,4500,0.035,1271,{0,0,0,0,1.04},"ItemDesc"},
  12.   {"M9 SD","M9 SD Mag",23,15,1,1882,2835,0.035,1271,{0,0,0,0,1.04},"ItemDesc"},
  13.   {"PDW","PDW Mag",28,30,1,14787,7700,0.1,2358,{0,0,0,0,0.5},"ItemDesc"},
  14.   {"MP5A5","MP5A5 Mag",29,20,1,1875,8900,0.1,2358,{0,0,0,0,0.5},"ItemDesc"},
  15.   {"Desert Eagle","Desert Eagle Mag",24,7,1,1272,8000,0.1,2358,{0,0,0,0,1.1},"ItemDesc"},
  16.   {"Hunting Knife","others",4,0,1,1273,8200,0.1,2358,{0,0,0,0,2.1},"ItemDesc"},
  17.   {"Golf Club","others",2,0,2,1852,1500,0,0,{3,2,4,3,2.1},"ItemDesc"},
  18.   {"Baseball Bat","others",5,0,2,1855,800,0,0,{3,1.5,0,1.4,2.2},"ItemDesc"},
  19.   {"Hatchet","others",8,0,2,1857,953,0,0,{3,1.5,0,1.9,3.4},"ItemDesc"},
  20.   {"Shovel","others",6,0,2,1856,953,0,0,{3,1.5,0,0,2.1},"ItemDesc"}, -- NOT DAYZ WEAPON
  21.   {"Grenade","others",16,0,3,342,17000,0,0,{0,0,0,0,2.1},"The Explosive Grenade is a explosive device that can be thrown. It is designed to eliminate big groups of hostiles"},
  22.   {"Tear Gas","others",17,0,3,343,0,0,0,{0,0,0,0,2.1},"The Flashbang is a non-lethal explosive device used to temporarily disorient an enemy's senses"},
  23.   {"Binoculars","others",43,0,3,367,0,0,0,{1,0,2,0,2.1},"The Binoculars is a hand-held device that can be used to view objects at a distance"},
  24.   {"Parachute","others",46,0,3,371,0,0,0,{0,0,0,0,1.3},"ItemDesc"},
  25.   {"Radio Device","others",1,0,1,1868,13000,0.1,2358,{0,0,0,0,1.7},"ItemDesc"},
  26.  
  27.  
  28.  
  29.  
  30. }
  31.  
  32. function getAllWeapons(player)
  33.   if not isElement(player) then
  34.     player = getLocalPlayer()
  35.   end
  36.   for i,weaponData in pairs(weaponTable)do
  37.     setElementData(player,weaponData[1],1)
  38.     if weaponData[2] ~= "others" then
  39.       setElementData(player,weaponData[2],100)
  40.     end
  41.   end
  42. end
  43.  
  44.  
  45. function isWeaponEquiped(weapType)
  46.   for i,weaponData in pairs(weaponTable)do
  47.     if getElementData(getLocalPlayer(),"currentweapon_"..weapType) == weaponData[1] then
  48.       return true
  49.     end
  50.   end
  51.   return false
  52. end
  53.  
  54. function getWeaponAmmoType(weaponName)
  55.   for i,weaponData in pairs(weaponTable)do
  56.     if weaponName == weaponData[1] then
  57.       if weaponData[2] == "others" then
  58.         return weaponData[1],weaponData[3]
  59.       else
  60.         return weaponData[2],weaponData[3]
  61.       end
  62.     end
  63.   end
  64.   return false
  65. end
  66.  
  67. function getDamageFromName(weapName)
  68.   for i,weaponData in pairs(weaponTable)do
  69.     if weaponData[1] == weapName then
  70.       return weaponData[7]
  71.     end
  72.   end
  73.   return false
  74. end
  75.  
  76. function getAmmoPlus(ammo)
  77.   for i,weaponData in pairs(weaponTable)do
  78.     if weaponData[2] == ammo then
  79.       return weaponData[4]
  80.     end
  81.   end
  82.   return 1
  83. end
  84.  
  85. function getWeaponDamage(weaponID,player)
  86.   for i,weaponData in pairs(weaponTable)do
  87.     local t,ID = getWeaponAmmoType(weaponData[1])
  88.     if ID == weaponID and (getElementData(player,"currentweapon_1") == weaponData[1] or getElementData(player,"currentweapon_2") == weaponData[1] or getElementData(player,"currentweapon_3") == weaponData[1] or getElementData(player,"currentweapon_4") == weaponData[1]) then
  89.       if getElementData(getLocalPlayer(),"humanity")== 5000 and(weaponData[5] == 4) then
  90.         return weaponData[7] * 0.3
  91.       end
  92.       return weaponData[7]
  93.     end
  94.   end
  95. end
Add Comment
Please, Sign In to add comment