Advertisement
Guest User

weps

a guest
Feb 21st, 2014
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.57 KB | None | 0 0
  1. -- 25/11/12 - Oringinally for Ban-Hammer.net
  2. -- Some basic TTT scripts for the non lua coders out there.
  3. -- Jason2010, Ollie, Q4-Bi.
  4. -- Custom chat bar friendly.
  5. if SERVER then
  6.     util.AddNetworkString("TTTChatText")
  7.     local white = Color(255,255,255)
  8.     local grey = Color(150,150,150)
  9.     local dgrey = Color(200,200,200)
  10.     -- Donater Weapons
  11.     function weaponStart( ply )
  12.        
  13.         local primaryWep = {"weapon_ttt_m16","Pistol",20,"an M16","weapon_zm_mac10","smg1",30,"a MAC10","weapon_zm_sledge","AirboatGun",0,"an M249 SAW","weapon_zm_shotgun","Buckshot",16,"a Shotgun","weapon_zm_rifle","357",10,"a Rifle"}
  14.        
  15.         local secondaryWep = {"weapon_zm_pistol","Pistol",20,"a Pistol","weapon_zm_revolver","AlyxGun",16,"a Desert Eagle","weapon_ttt_glock","Pistol",20,"a Glock"}
  16.        
  17.         local grenadeWep = {"weapon_tttbasegrenade","an Incendiary Grenade","weapon_ttt_confgrenade","a Discombobulator","weapon_ttt_smokegrenade","a Smoke Grenade"}
  18.         if ply:Team() == 1 then
  19.             if(ply:IsUserGroup("donator") or ply:IsUserGroup("moderator") or ply:IsAdmin() or ply:IsSuperAdmin()) then
  20.                
  21.                 -- Primary Weapon Start
  22.                 pDisplay = math.random(1,5)*4
  23.                 pAmmo,pType,pName = primaryWep[pDisplay-1],primaryWep[pDisplay-2],primaryWep[pDisplay-3]
  24.                 pDisplay = primaryWep[pDisplay]
  25.                 ply:Give(pName)
  26.                 ply:GiveAmmo(pAmmo,pType)
  27.                
  28.                 -- Secondary Start
  29.                 sDisplay = math.random(1,3)*4
  30.                 sAmmo,sType,sName = secondaryWep[sDisplay-1],secondaryWep[sDisplay-2],secondaryWep[sDisplay-3]
  31.                 sDisplay = secondaryWep[sDisplay]  
  32.                 ply:Give(sName)
  33.                 ply:GiveAmmo(sAmmo,sType)
  34.                
  35.                 -- Grenade Start
  36.                 gDisplay = math.random(1,3)*2
  37.                 gName = grenadeWep[gDisplay-1]
  38.                 gDisplay = grenadeWep[gDisplay]
  39.                 ply:Give(gName)
  40.                 net.Start("TTTChatText")
  41.                     net.WriteTable({grey,"[",white,"DonatorWeps",grey,"]",white,": ",dgrey,"You received ".. pDisplay .. " with " .. sDisplay .. " and " .. gDisplay .. "!"})
  42.                 net.Send(ply)
  43.             end
  44.             local knifeFun = true
  45.         end
  46.     end
  47.     hook.Add("PlayerSpawn", "weaponStart", weaponStart )
  48.     -- Donater Weapons Finished
  49.  
  50.  
  51. end
  52. if CLIENT then
  53.     net.Receive("TTTChatText",function()
  54.     local tbl = net.ReadTable()
  55.     if tbl != nil then
  56.     chat.AddText(unpack(tbl))
  57.     else
  58.     print("Empty table received!")
  59.     end
  60.     end)
  61.    
  62. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement