Advertisement
Guest User

Untitled

a guest
Aug 19th, 2014
270
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. AddCSLuaFile("cl_init.lua")
  2. AddCSLuaFile("shared.lua")
  3. include('shared.lua')
  4.  
  5. local BankVault
  6. function SpawnBankVault()
  7. if not file.IsDir("craphead_scripts", "DATA") then
  8. file.CreateDir("craphead_scripts", "DATA")
  9. end
  10.  
  11. if not file.IsDir("craphead_scripts/bank_robbery", "DATA") then
  12. file.CreateDir("craphead_scripts/bank_robbery", "DATA")
  13. end
  14.  
  15. if not file.Exists( "craphead_scripts/bank_robbery/bankvault_location.txt", "DATA" ) then
  16. file.Write("craphead_scripts/bank_robbery/bankvault_location.txt", "0;-0;-0;0;0;0", "DATA")
  17. end
  18.  
  19. local PositionFile = file.Read("craphead_scripts/bank_robbery/bankvault_location.txt", "DATA")
  20.  
  21. local ThePosition = string.Explode( ";", PositionFile )
  22.  
  23. local TheVector = Vector(ThePosition[1], ThePosition[2], ThePosition[3])
  24. local TheAngle = Angle(tonumber(ThePosition[4]), ThePosition[5], ThePosition[6])
  25.  
  26. BankVault = ents.Create("bank_vault")
  27. BankVault:SetModel("models/props/cs_assault/moneypallet.mdl")
  28. BankVault:SetPos(TheVector)
  29. BankVault:SetAngles(TheAngle)
  30.  
  31. BankVault:Spawn()
  32. BankVault:SetMoveType(MOVETYPE_NONE)
  33. BankVault:SetSolid( SOLID_BBOX )
  34. BankVault:SetCollisionGroup(COLLISION_GROUP_PLAYER)
  35. end
  36. timer.Simple(1, SpawnBankVault)
  37.  
  38. function CH_BankVault_Position( ply )
  39. if ply:IsAdmin() then
  40. local HisVector = string.Explode(" ", tostring(ply:GetPos()))
  41. local HisAngles = string.Explode(" ", tostring(ply:GetAngles()))
  42.  
  43. file.Write("craphead_scripts/bank_robbery/bankvault_location.txt", ""..(HisVector[1])..";"..(HisVector[2])..";"..(HisVector[3])..";"..(HisAngles[1])..";"..(HisAngles[2])..";"..(HisAngles[3]).."", "DATA")
  44. ply:ChatPrint("New position for the bank vault has been succesfully set. Please restart your server!")
  45. else
  46. ply:ChatPrint("Only administrators can perform this action")
  47. end
  48. end
  49. concommand.Add("bankvault_setpos", CH_BankVault_Position)
  50.  
  51. function ENT:AcceptInput(ply, caller)
  52. if caller:IsPlayer() && !caller.CantUse then
  53. caller.CantUse = true
  54. timer.Simple(3, function() caller.CantUse = false end)
  55.  
  56. if caller:IsValid() then
  57. BANK_BeginRobbery( caller )
  58. end
  59. end
  60. end
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement