Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 18.85 KB | None | 0 0
  1.  
  2.  
  3. function buyweapons ( thePlayer, commandName, wid, clip)
  4.     if ( thePlayer ) then
  5.         local weapon = getWeaponNameFromID ( wid )
  6.         local weaponid = getWeaponIDFromName ( weapon )
  7.         local money = getPlayerMoney ( thePlayer )
  8.         if ( weaponid == 1 ) then
  9.             if money >= 1000 then
  10.                 giveWeapon ( thePlayer, 1 )
  11.                 takePlayerMoney ( thePlayer, 1000 )
  12.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. "#0000FF!", thePlayer, 0, 255, 255, true)
  13.             else
  14.                 outputChatBox ( "* #FFFFFFYou don't have enought money to buy #FF0000" .. weapon , thePlayer, 255, 0, 0, true)
  15.             end
  16.         elseif ( weaponid == 2 ) then
  17.             if money >= 1500 then
  18.                 giveWeapon ( thePlayer, 2 )
  19.                 takePlayerMoney ( thePlayer, 1500 )
  20.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. "!", thePlayer, 0, 255, 255, true)
  21.             else
  22.                 outputChatBox ( "* You don't have enought money to buy #FF0000" ..weapon , thePlayer, 255, 0, 0, true)
  23.             end
  24.         elseif ( weaponid == 3 ) then
  25.             if money >= 100 then
  26.                 giveWeapon ( thePlayer, 3)
  27.                 takePlayerMoney ( thePlayer, 100 )
  28.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. "!", thePlayer, 0, 255, 255, true)
  29.             else
  30.                 outputChatBox ( "* You don't have enought money to buy #FF0000" ..weapon , thePlayer, 255, 0, 0, true)
  31.             end
  32.         elseif ( weaponid == 4 ) then
  33.             if money >= 100000 then
  34.                 giveWeapon ( thePlayer, 4)
  35.                 takePlayerMoney ( thePlayer, 100000 )
  36.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. "!", thePlayer, 0, 255, 255, true)
  37.             else
  38.                 outputChatBox ( "* You don't have enought money to buy #FF0000" ..weapon , thePlayer, 255, 0, 0, true)
  39.             end
  40.         elseif ( weaponid == 5 ) then
  41.             if money >= 100 then
  42.                 giveWeapon ( thePlayer, 5)
  43.                 takePlayerMoney ( thePlayer, 100 )
  44.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. "!", thePlayer, 0, 255, 255, true)
  45.             else
  46.                 outputChatBox ( "* You don't have enought money to buy #FF0000" ..weapon , thePlayer, 255, 0, 0, true)
  47.             end
  48.         elseif ( weaponid == 6 ) then
  49.             if money >= 50 then
  50.                 giveWeapon ( thePlayer, 6)
  51.                 takePlayerMoney ( thePlayer, 50 )
  52.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. "!", thePlayer, 0, 255, 255, true)
  53.             else
  54.                 outputChatBox ( "* You don't have enought money to buy #FF0000" ..weapon , thePlayer, 255, 0, 0, true)
  55.             end
  56.         elseif ( weaponid == 7 ) then
  57.             if money >= 100 then
  58.                 giveWeapon ( thePlayer, 7)
  59.                 takePlayerMoney ( thePlayer, 100 )
  60.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. "!", thePlayer, 0, 255, 255, true)
  61.             else
  62.                 outputChatBox ( "* You don't have enought money to buy #FF0000" ..weapon , thePlayer, 255, 0, 0, true)
  63.             end
  64.         elseif ( weaponid == 8 ) then
  65.             if money >= 100000 then
  66.                 giveWeapon ( thePlayer, 8)
  67.                 takePlayerMoney ( thePlayer, 100000 )
  68.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. "!", thePlayer, 0, 255, 255, true)
  69.             else
  70.                 outputChatBox ( "* You don't have enought money to buy #FF0000" ..weapon , thePlayer, 255, 0, 0, true)
  71.             end
  72.         elseif ( weaponid == 9 ) then
  73.             if money >= 500 then
  74.                 giveWeapon ( thePlayer, 9)
  75.                 takePlayerMoney ( thePlayer, 500 )
  76.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. "!", thePlayer, 0, 255, 255, true)
  77.             else
  78.                 outputChatBox ( "* You don't have enought money to buy #FF0000" ..weapon , thePlayer, 255, 0, 0, true)
  79.             end
  80.         elseif ( weaponid == 10 ) then
  81.             if money >= 50 then
  82.                 giveWeapon ( thePlayer, 10)
  83.                 takePlayerMoney ( thePlayer, 50 )
  84.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. "!", thePlayer, 0, 255, 255, true)
  85.             else
  86.                 outputChatBox ( "* You don't have enought money to buy #FF0000" ..weapon , thePlayer, 255, 0, 0, true)
  87.             end
  88.         elseif ( weaponid == 11 ) then
  89.             if money >= 100 then
  90.                 giveWeapon ( thePlayer, 11)
  91.                 takePlayerMoney ( thePlayer, 100 )
  92.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. "!", thePlayer, 0, 255, 255, true)
  93.             else
  94.                 outputChatBox ( "* You don't have enought money to buy #FF0000" ..weapon , thePlayer, 255, 0, 0, true)
  95.             end
  96.         elseif ( weaponid == 12 ) then
  97.             if money >= 100 then
  98.                 giveWeapon ( thePlayer, 12)
  99.                 takePlayerMoney ( thePlayer, 100 )
  100.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. "!", thePlayer, 0, 255, 255, true)
  101.             else
  102.                 outputChatBox ( "* You don't have enought money to buy #FF0000" ..weapon , thePlayer, 255, 0, 0, true)
  103.             end
  104.         elseif ( weaponid == 14 ) then
  105.             if money >= 10 then
  106.                 giveWeapon ( thePlayer, 14)
  107.                 takePlayerMoney ( thePlayer, 10 )
  108.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. "!", thePlayer, 0, 255, 255, true)
  109.             else
  110.                 outputChatBox ( "* You don't have enought money to buy #FF0000" ..weapon , thePlayer, 255, 0, 0, true)
  111.             end
  112.         elseif ( weaponid == 15 ) then
  113.             if money >= 100 then
  114.                 giveWeapon ( thePlayer, 15)
  115.                 takePlayerMoney ( thePlayer, 100 )
  116.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. "!", thePlayer, 0, 255, 255, true)
  117.             else
  118.                 outputChatBox ( "* You don't have enought money to buy #FF0000" ..weapon , thePlayer, 255, 0, 0, true)
  119.             end
  120.         elseif ( weaponid == 44 ) then
  121.             if money >= 100 then
  122.                 giveWeapon ( thePlayer, 3)
  123.                 takePlayerMoney ( thePlayer, 100 )
  124.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. "!", thePlayer, 0, 255, 255, true)
  125.             else
  126.                 outputChatBox ( "* You don't have enought money to buy #FF0000" ..weapon , thePlayer, 255, 0, 0, true)
  127.             end
  128.         elseif ( weaponid == 45 ) then
  129.             if money >= 1000 then
  130.                 giveWeapon ( thePlayer, 3)
  131.                 takePlayerMoney ( thePlayer, 1000 )
  132.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. "!", thePlayer, 0, 255, 255, true)
  133.             else
  134.                 outputChatBox ( "* You don't have enought money to buy #FF0000" ..weapon , thePlayer, 255, 0, 0, true)
  135.             end
  136.         elseif ( weaponid == 46 ) then
  137.             if money >= 10 then
  138.                 giveWeapon ( thePlayer, 46)
  139.                 takePlayerMoney ( thePlayer, 10 )
  140.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. "!", thePlayer, 0, 255, 255, true)
  141.             else
  142.                 outputChatBox ( "* You don't have enought money to buy #FF0000" ..weapon , thePlayer, 255, 0, 0, true)
  143.             end
  144.         elseif ( weaponid == 22 ) then
  145.             if money >= 500*clip then
  146.                 ammo = 17*clip
  147.                 giveWeapon ( thePlayer, 22, ammo )
  148.                 takePlayerMoney ( thePlayer, 500*clip )
  149.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. " #0000FFand #FF0000" .. clip .." #0000FFclips of ammo for it!", thePlayer, 0, 255, 255, true)
  150.             else
  151.                 outputChatBox ( "* #FFFFFFYou don't have enought money to buy #FF0000" ..clip.." #FFFFFFclips of ammo for #FF0000" ..weapon.. "#FFFFFF!", thePlayer, 255, 0, 0,true)
  152.             end
  153.         elseif ( weaponid == 23 ) then
  154.             if money >= 500*clip then
  155.                 ammo = 17*clip
  156.                 giveWeapon ( thePlayer, 23, ammo )
  157.                 takePlayerMoney ( thePlayer, 500*clip )
  158.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. " #0000FFand #FF0000" .. clip .." #0000FFclips of ammo for it!", thePlayer, 0, 255, 255, true)
  159.             else
  160.                 outputChatBox ( "* #FFFFFFYou don't have enought money to buy #FF0000" ..clip.." #FFFFFFclips of ammo for #FF0000" ..weapon.. "#FFFFFF!", thePlayer, 255, 0, 0, true)
  161.             end
  162.         elseif ( weaponid == 24 ) then
  163.             if money >= 450*clip then
  164.                 ammo = 7*clip
  165.                 giveWeapon ( thePlayer, 24, ammo )
  166.                 takePlayerMoney ( thePlayer, 450*clip )
  167.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. " #0000FFand #FF0000" .. clip .." #0000FFclips of ammo for it!", thePlayer, 0, 255, 255, true)
  168.             else
  169.                 outputChatBox ( "* #FFFFFFYou don't have enought money to buy #FF0000" ..clip.." #FFFFFFclips of ammo for #FF0000" ..weapon.. "#FFFFFF!", thePlayer, 255, 0, 0, true)
  170.             end
  171.         elseif ( weaponid == 25 ) then
  172.             if money >= 25*clip then
  173.                 ammo = 1*clip
  174.                 giveWeapon ( thePlayer, 25, ammo )
  175.                 takePlayerMoney ( thePlayer, 25*clip )
  176.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. " #0000FFand #FF0000" .. clip .." #0000FFclips of ammo for it!", thePlayer, 0, 255, 255, true)
  177.             else
  178.                 outputChatBox ( "* #FFFFFFYou don't have enought money to buy #FF0000" ..clip.." #FFFFFFclips of ammo for #FF0000" ..weapon.. "#FFFFFF!", thePlayer, 255, 0, 0, true)
  179.             end
  180.         elseif ( weaponid == 26 ) then
  181.             if money >= 150*clip then
  182.                 ammo = 2*clip
  183.                 giveWeapon ( thePlayer, 26, ammo )
  184.                 takePlayerMoney ( thePlayer, 150*clip )
  185.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. " #0000FFand #FF0000" .. clip .." #0000FFclips of ammo for it!", thePlayer, 0, 255, 255, true)
  186.             else
  187.                 outputChatBox ( "* #FFFFFFYou don't have enought money to buy #FF0000" ..clip.." #FFFFFFclips of ammo for #FF0000" ..weapon.. "#FFFFFF!", thePlayer, 255, 0, 0, true)
  188.             end
  189.         elseif ( weaponid == 27 ) then
  190.             if money >= 350*clip then
  191.                 ammo = 7*clip
  192.                 giveWeapon ( thePlayer, 27, ammo )
  193.                 takePlayerMoney ( thePlayer, 350*clip )
  194.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. " #0000FFand #FF0000" .. clip .." #0000FFclips of ammo for it!", thePlayer, 0, 255, 255, true)
  195.             else
  196.                 outputChatBox ( "* #FFFFFFYou don't have enought money to buy #FF0000" ..clip.." #FFFFFFclips of ammo for #FF0000" ..weapon.. "#FFFFFF!", thePlayer, 255, 0, 0, true)
  197.             end
  198.         elseif ( weaponid == 28 ) then
  199.             if money >= 750*clip then
  200.                 ammo = 50*clip
  201.                 giveWeapon ( thePlayer, 28, ammo )
  202.                 takePlayerMoney ( thePlayer, 750*clip )
  203.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. " #0000FFand #FF0000" .. clip .." #0000FFclips of ammo for it!", thePlayer, 0, 255, 255, true)
  204.             else
  205.                 outputChatBox ( "* #FFFFFFYou don't have enought money to buy #FF0000" ..clip.." #FFFFFFclips of ammo for #FF0000" ..weapon.. "#FFFFFF!", thePlayer, 255, 0, 0, true)
  206.             end
  207.         elseif ( weaponid == 29 ) then
  208.             if money >= 850*clip then
  209.                 ammo = 30*clip
  210.                 giveWeapon ( thePlayer, 29, ammo )
  211.                 takePlayerMoney ( thePlayer, 650*clip )
  212.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. " #0000FFand #FF0000" .. clip .." #0000FFclips of ammo for it!", thePlayer, 0, 255, 255, true)
  213.             else
  214.                 outputChatBox ( "* #FFFFFFYou don't have enought money to buy #FF0000" ..clip.." #FFFFFFclips of ammo for #FF0000" ..weapon.. "#FFFFFF!", thePlayer, 255, 0, 0, true)
  215.             end
  216.         elseif ( weaponid == 32 ) then
  217.             if money >= 800*clip then
  218.                 ammo = 50*clip
  219.                 giveWeapon ( thePlayer, 32, ammo )
  220.                 takePlayerMoney ( thePlayer, 800*clip )
  221.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. " #0000FFand #FF0000" .. clip .." #0000FFclips of ammo for it!", thePlayer, 0, 255, 255, true)
  222.             else
  223.                 outputChatBox ( "* #FFFFFFYou don't have enought money to buy #FF0000" ..clip.." #FFFFFFclips of ammo for #FF0000" ..weapon.. "#FFFFFF!", thePlayer, 255, 0, 0, true)
  224.             end
  225.         elseif ( weaponid == 30 ) then
  226.             if money >= 1000*clip then
  227.                 ammo = 30*clip
  228.                 giveWeapon ( thePlayer, 30, ammo )
  229.                 takePlayerMoney ( thePlayer, 1000*clip )
  230.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. " #0000FFand #FF0000" .. clip .." #0000FFclips of ammo for it!", thePlayer, 0, 255, 255, true)
  231.             else
  232.                 outputChatBox ( "* #FFFFFFYou don't have enought money to buy #FF0000" ..clip.." #FFFFFFclips of ammo for #FF0000" ..weapon.. "#FFFFFF!", thePlayer, 255, 0, 0, true)
  233.             end
  234.         elseif ( weaponid == 31 ) then
  235.             if money >= 1250*clip then
  236.                 ammo = 50*clip
  237.                 giveWeapon ( thePlayer, 31, ammo )
  238.                 takePlayerMoney ( thePlayer, 1250*clip )
  239.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. " #0000FFand #FF0000" .. clip .." #0000FFclips of ammo for it!", thePlayer, 0, 255, 255, true)
  240.             else
  241.                 outputChatBox ( "* #FFFFFFYou don't have enought money to buy #FF0000" ..clip.." #FFFFFFclips of ammo for #FF0000" ..weapon.. "#FFFFFF!", thePlayer, 255, 0, 0, true)
  242.             end
  243.         elseif ( weaponid == 33 ) then
  244.             if money >= 30*clip then
  245.                 ammo = 1*clip
  246.                 giveWeapon ( thePlayer, 33, ammo )
  247.                 takePlayerMoney ( thePlayer, 30*clip )
  248.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. " #0000FFand #FF0000" .. clip .." #0000FFclips of ammo for it!", thePlayer, 0, 255, 255, true)
  249.             else
  250.                 outputChatBox ( "* #FFFFFFYou don't have enought money to buy #FF0000" ..clip.." #FFFFFFclips of ammo for #FF0000" ..weapon.. "#FFFFFF!", thePlayer, 255, 0, 0, true)
  251.             end
  252.         elseif ( weaponid == 34 ) then
  253.             if money >= 50*clip then
  254.                 ammo = 1*clip
  255.                 giveWeapon ( thePlayer, 34, ammo )
  256.                 takePlayerMoney ( thePlayer, 50*clip )
  257.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. " #0000FFand #FF0000" .. clip .." #0000FFclips of ammo for it!", thePlayer, 0, 255, 255, true)
  258.             else
  259.                 outputChatBox ( "* #FFFFFFYou don't have enought money to buy #FF0000" ..clip.." #FFFFFFclips of ammo for #FF0000" ..weapon.. "#FFFFFF!", thePlayer, 255, 0, 0, true)
  260.             end
  261.         elseif ( weaponid == 35 ) then
  262.             if money >= 5000*clip then
  263.                 ammo = 1*clip
  264.                 giveWeapon ( thePlayer, 35, ammo )
  265.                 takePlayerMoney ( thePlayer, 5000*clip )
  266.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. " #0000FFand #FF0000" .. clip .." #0000FFclips of ammo for it!", thePlayer, 0, 255, 255, true)
  267.             else
  268.                 outputChatBox ( "* #FFFFFFYou don't have enought money to buy #FF0000" ..clip.." #FFFFFFclips of ammo for #FF0000" ..weapon.. "#FFFFFF!", thePlayer, 255, 0, 0, true)
  269.             end
  270.         elseif ( weaponid == 36 ) then
  271.             if money >= 10000*clip then
  272.                 ammo = 1*clip
  273.                 giveWeapon ( thePlayer, 36, ammo )
  274.                 takePlayerMoney ( thePlayer, 10000*clip )
  275.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. " #0000FFand #FF0000" .. clip .." #0000FFclips of ammo for it!", thePlayer, 0, 255, 255, true)
  276.             else
  277.                 outputChatBox ( "* #FFFFFFYou don't have enought money to buy #FF0000" ..clip.." #FFFFFFclips of ammo for #FF0000" ..weapon.. "#FFFFFF!", thePlayer, 255, 0, 0, true)
  278.             end
  279.         elseif ( weaponid == 37 ) then
  280.             if money >= 400*clip then
  281.                 ammo = 50*clip
  282.                 giveWeapon ( thePlayer, 37, ammo )
  283.                 takePlayerMoney ( thePlayer, 400*clip )
  284.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. " #0000FFand #FF0000" .. clip .." #0000FFclips of ammo for it!", thePlayer, 0, 255, 255, true)
  285.             else
  286.                 outputChatBox ( "* #FFFFFFYou don't have enought money to buy #FF0000" ..clip.." #FFFFFFclips of ammo for #FF0000" ..weapon.. "#FFFFFF!", thePlayer, 255, 0, 0, true)
  287.             end
  288.         elseif ( weaponid == 38 ) then
  289.             if money >= 25000*clip then
  290.                 ammo = 500*clip
  291.                 giveWeapon ( thePlayer, 38, ammo )
  292.                 takePlayerMoney ( thePlayer, 25000*clip )
  293.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. " #0000FFand #FF0000" .. clip .." #0000FFclips of ammo for it!", thePlayer, 0, 255, 255, true)
  294.             else
  295.                 outputChatBox ( "* #FFFFFFYou don't have enought money to buy #FF0000" ..clip.." #FFFFFFclips of ammo for #FF0000" ..weapon.. "#FFFFFF!", thePlayer, 255, 0, 0, true)
  296.             end
  297.         elseif ( weaponid == 16 ) then
  298.             if money >= 900*clip then
  299.                 ammo = 1*clip
  300.                 giveWeapon ( thePlayer, 16, ammo )
  301.                 takePlayerMoney ( thePlayer, 900*clip )
  302.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. " #0000FFand #FF0000" .. clip .." #0000FFclips of ammo for it!", thePlayer, 0, 255, 255, true)
  303.             else
  304.                 outputChatBox ( "* #FFFFFFYou don't have enought money to buy #FF0000" ..clip.." #FFFFFFclips of ammo for #FF0000" ..weapon.. "#FFFFFF!", thePlayer, 255, 0, 0, true)
  305.             end
  306.         elseif ( weaponid == 17 ) then
  307.             if money >= 750*clip then
  308.                 ammo = 1*clip
  309.                 giveWeapon ( thePlayer, 17, ammo )
  310.                 takePlayerMoney ( thePlayer, 750*clip )
  311.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. " #0000FFand #FF0000" .. clip .." #0000FFclips of ammo for it!", thePlayer, 0, 255, 255, true)
  312.             else
  313.                 outputChatBox ( "* #FFFFFFYou don't have enought money to buy #FF0000" ..clip.." #FFFFFFclips of ammo for #FF0000" ..weapon.. "#FFFFFF!", thePlayer, 255, 0, 0, true)
  314.             end
  315.         elseif ( weaponid == 18 ) then
  316.             if money >= 250*clip then
  317.                 ammo = 1*clip
  318.                 giveWeapon ( thePlayer, 18, ammo )
  319.                 takePlayerMoney ( thePlayer, 250*clip )
  320.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. " #0000FFand #FF0000" .. clip .." #0000FFclips of ammo for it!", thePlayer, 0, 255, 255, true)
  321.             else
  322.                 outputChatBox ( "* #FFFFFFYou don't have enought money to buy #FF0000" ..clip.." #FFFFFFclips of ammo for #FF0000" ..weapon.. "#FFFFFF!", thePlayer, 255, 0, 0, true)
  323.             end
  324.         elseif ( weaponid == 39 ) then
  325.             if money >= 750*clip then
  326.                 ammo = 1*clip
  327.                 giveWeapon ( thePlayer, 39, ammo )
  328.                 takePlayerMoney ( thePlayer, 750*clip )
  329.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. " #0000FFand #FF0000" .. clip .." #0000FFclips of ammo for it!", thePlayer, 0, 255, 255, true)
  330.             else
  331.                 outputChatBox ( "* #FFFFFFYou don't have enought money to buy #FF0000" ..clip.." #FFFFFFclips of ammo for #FF0000" ..weapon.. "#FFFFFF!", thePlayer, 255, 0, 0, true)
  332.             end
  333.         elseif ( weaponid == 41 ) then
  334.             if money >= 500*clip then
  335.                 ammo = 500*clip
  336.                 giveWeapon ( thePlayer, 41, ammo )
  337.                 takePlayerMoney ( thePlayer, 500*clip )
  338.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. " #0000FFand #FF0000" .. clip .." #0000FFclips of ammo for it!", thePlayer, 0, 255, 255, true)
  339.             else
  340.                 outputChatBox ( "* #FFFFFFYou don't have enought money to buy #FF0000" ..clip.." #FFFFFFclips of ammo for #FF0000" ..weapon.. "#FFFFFF!", thePlayer, 255, 0, 0, true)
  341.             end
  342.         elseif ( weaponid == 42 ) then
  343.             if money >= 50*clip then
  344.                 ammo = 500*clip
  345.                 giveWeapon ( thePlayer, 42, ammo )
  346.                 takePlayerMoney ( thePlayer, 50*clip )
  347.                 outputChatBox ( "* #0000FFCongratulations you have bought #FF0000" .. weapon .. " #0000FFand #FF0000" .. clip .." #0000FFclips of ammo for it!", thePlayer, 0, 255, 255, true)
  348.             else
  349.                 outputChatBox ( "* #FFFFFFYou don't have enought money to buy #FF0000" ..clip.." #FFFFFFclips of ammo for #FF0000" ..weapon.. "#FFFFFF!", thePlayer, 255, 0, 0, true)
  350.             end
  351.         else
  352.             outputChatBox ( "* #FFFFFFInvalid weapon ID: #FF0000".. wid .. "#FFFFFF!", thePlayer, 255, 0, 0, true)
  353.         end
  354.     else
  355.         outputChatBox("debug1s")
  356.     end
  357. end
  358. addEvent("buyweaponevent", true)
  359. addEventHandler("buyweaponevent", getRootElement(), buyweapons)
  360. addCommandHandler ("buyweapon", buyweapons)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement