Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AddCSLuaFile("cl_init.lua")
- AddCSLuaFile("shared.lua")
- include("shared.lua")
- util.AddNetworkString("BombDefuseStart")
- util.AddNetworkString("Fuse")
- util.AddNetworkString("beep")
- util.AddNetworkString("BombDefuseSuccess")
- util.AddNetworkString("BombDefuseFail")
- function ENT:Initialize()
- self:SetModel("models/Combine_Helicopter/helicopter_bomb01.mdl")
- self:PhysicsInit(SOLID_VPHYSICS)
- self:SetMoveType(MOVETYPE_VPHYSICS)
- self:SetSolid(SOLID_VPHYSICS)
- self:SetUseType(SIMPLE_USE)
- local phys = self:GetPhysicsObject()
- if phys:IsValid() then phys:Wake() end
- local BombInitialPosition = self:GetPos()
- print(BombInitialPosition)
- function bombRemove()
- print("Removed a bomb.")
- self:Remove()
- end
- isBombFused = false
- end
- --explode function to be called later
- function BombExplode(me)
- --the actual explosion part
- util.BlastDamage(me,me, BombInitialPosition, 2500, 700)
- local explosioneffect = EffectData()
- explosioneffect:SetScale(15)
- explosioneffect:SetOrigin(BombInitialPosition)
- local explosioneffect2 = EffectData()
- explosioneffect2:SetScale(17)
- explosioneffect2:SetOrigin(BombInitialPosition)
- util.Effect("Explosion", explosioneffect)
- util.Effect("RPGShotDown", explosioneffect2)
- bombRemove()
- end --end of explode function
- function ENT:Use(ply,c)
- if isBombFused == false then
- BombStart()
- else
- net.Start("BombDefuseStart")
- net.Send(ply)
- end
- end
- function BombStart()
- printedTime = BombFuseTimer
- timer.Create("Fuse timer", 1, BombFuseTimer, BombTick())
- BombExplode()
- end
- function BombTick()
- print(printedTime)
- printedTime = printedTime - 1
- end
- net.Receive("DefuseSuccess", function(len,ply)
- PrintMessage(HUD_PRINTTALK,ply:Nick().." has successfully defused a bomb!!!")
- bombRemove()
- end)
- net.Receive("DefuseFail", function(len,ply)
- PrintMessage(HUD_PRINTTALK,ply:Nick().." has cut the wrong wire and detonated a bomb!")
- BombExplode(ply)
- end)
- net.Receive("BombStart", BombStart())
- function ENT:SetupDataTables()
- //??????
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement