Welcome, Guest. Please login or register.
Did you miss your activation email?
November 21, 2024, 02:48:05 PM
Home Help Login Register
News: Zombie Master 2 discussion

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: TTT Defibrillator, can it be done?
Pages: [1]
Author Topic: TTT Defibrillator, can it be done?  (Read 22897 times)
Phish
Poster

Posts: 6


« on: March 01, 2012, 06:42:17 AM »

Heres what I've scooped off the internet from some anon.

if SERVER then
  AddCSLuaFile( "shared.lua" )
  resource.AddFile("models/weapons/v_defilibrator.mdl")
  resource.AddFile("models/weapons/v_defilibrator.dx90.vtx")
  resource.AddFile("models/weapons/v_defilibrator.dv80.vtx")
  resource.AddFile("models/weapons/v_defilibrator.vtx")
  resource.AddFile("models/weapons/v_defilibrator..sw.vtx")
  resource.AddFile("models/weapons/v_defilibrator.vvd")
  resource.AddFile("materials/models/weapons/v_defilibrator/Paddle.vmt")
  resource.AddFile("materials/models/weapons/v_defilibrator/v_hand_sheet.vmt")
  resource.AddFile("materials/models/weapons/v_defilibrator/v_hand_sheet_normal.vmt")
  resource.AddFile("materials/vgui/ttt/icon_sourcetribe_defib.vmt")
  resource.AddFile("sound/ttt/ael.wav")
  resource.AddFile("sound/ttt/leeroy_boom.wav")
  resource.AddFile("sound/ttt/DefendThisPosition.wav")
end


if CLIENT then
  SWEP.PrintName = "Defibrillator"
  SWEP.Slot = 6

  SWEP.ViewModelFOV = 10

  SWEP.EquipMenuData = {
      type = "item_weapon",
      desc =
[[Revives you allies.]]
  };

  SWEP.Icon = "vgui/ttt/icon_AM_defib"
end

SWEP.ViewModelFOV = 70
SWEP.ViewModelFlip = false
SWEP.ViewModel = "models/weapons/v_defilibrator.mdl"
--SWEP.WorldModel = ""
SWEP.ShowViewModel = true
SWEP.ShowWorldModel = false

--[[SWEP.VElements = {
["microwave"] = { type = "Model", model = "models/props/cs_office/microwave.mdl", bone = "ValveBiped.Bip01", pos = Vector(11.019, -21.619, 15.625), angle = Angle(-3.57, 8.512, -90.644), size = Vector(0.4, 0.4, 0.4), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}--]]

SWEP.Base = "weapon_tttbase"

SWEP.DrawCrosshair      = false
SWEP.Primary.ClipSize      = -1
SWEP.Primary.DefaultClip    = -1
SWEP.Primary.Automatic      = false
SWEP.Primary.Ammo      = "none"
SWEP.Primary.Delay = 1.0

SWEP.Secondary.ClipSize    = -1
SWEP.Secondary.DefaultClip  = -1
SWEP.Secondary.Automatic    = false
SWEP.Secondary.Ammo    = "none"
SWEP.Secondary.Delay = 1.0

SWEP.Kind = WEAPON_EQUIP
SWEP.CanBuy = {ROLE_DETECTIVE}
SWEP.LimitedStock = true
SWEP.WeaponID = AMMO_DEFIB
SWEP.AllowDrop = false
SWEP.NoSights = true

if CLIENT then
function SWEP:GetViewModelPosition ( Pos, Ang )
Pos = Pos + Ang:Up() * 6

return Pos, Ang
end
end

function SWEP:Initialize()
self:SetWeaponHoldType("normal")
end
if SERVER then
function SWEP:PrimaryAttack()
local EyeTrace = self.Owner:GetEyeTrace()
local Distance = self.Owner:EyePos():Distance(EyeTrace.HitPos)

if Distance > 75 then return false end
if ValidEntity(EyeTrace.Entity) and EyeTrace.Entity:GetClass() == "prop_ragdoll" then
local ply = CORPSE.GetPlayer(EyeTrace.Entity, false)
if ply then
if ply:GetRole() == ROLE_TRAITOR then self.Owner:PrintMessage(HUD_PRINTTALK, "ERROR: This is not an innocent!") return end

local time = 25
if ( ply:GetNWString("DonorStatus", Guest)== "Bronze") then time = 40
elseif ( ply:GetNWString("DonorStatus", Guest)== "Silver") then time = 75
elseif ( ply:GetNWString("DonorStatus", Guest)== "Gold") then time = 150
elseif ( ply:GetNWString("DonorStatus", Guest)== "Diamond") then time = 250
elseif ( ply:GetNWString("DonorStatus", Guest)== "Platinum") then time = 500
elseif ( ply:GetNWString("DonorStatus", Guest)== "CoOwner") then time = 1000
elseif ( ply:GetNWString("DonorStatus", Guest)== "Founder") then time = 1000000
end
if (tonumber(ply.DiedTime) + time) < CurTime() then self.Owner:PrintMessage(HUD_PRINTTALK, "ERROR: Player has been dead for more than "..time.." seconds!") return end

local ent = EyeTrace.Entity
local player = self.Owner
self.Owner:Freeze(true)
self.Owner:EmitSound("AM/DefendThisPosition.wav", 150, 100)
timer.Simple(4, function() if player:Alive() then self.Owner:EmitSound("AM/ael.wav", 150, 100) end end)
timer.Simple(5, function()
if player:Alive() then
self:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
self.Owner:Freeze(false)
self.Owner:EmitSound("AM/leeroy_boom.wav", 100, 100)
ply:SpawnForRound(true)
ply:SetPos(ent:GetPos())
ply.ShouldntCollide = true
timer.Simple(5, function() ply.ShouldntCollide = false end)
ent:Remove()
self:Remove()
end
end)

else
self.Owner:PrintMessage(HUD_PRINTTALK, "ERROR: Unable to retrieve player/ player is not an innocent.")
end
else
self.Owner:PrintMessage(HUD_PRINTTALK, "ERROR: This is not a corpse!")
end
end
end


hook.Add("ShouldCollide", "PlayerDefib", function(ent1, ent2)
if ent1:IsPlayer() and ent2:IsPlayer() then
if ent1.ShouldntCollide then
return false
elseif ent2.ShouldntCollide then
return false
end
end
end)

function SWEP:SecondaryAttack()
  return false
end

function SWEP:Reload()
  return false
end


Ignore the stupid sounds, I just added them as temps. It doesnt work however. It just doesnt revive.

I would like to end up making there be a 10% chance of the revived turning traitor.... but that is way over my head!
BipolarDiZ
Poster

Posts: 101


|:NxS:| Staff! :D


« Reply #1 on: March 01, 2012, 08:41:08 PM »

To be honest, even if this worked it is a very bad idea for TTT. To be dead and come back to life would destroy the whole game play. First off they would at least be able to call out one of the traitors right off the spot. Second they were dead meaning they know a lot already, such as who else was dead or most likely who all of the traitors are.

This seems like a very bad idea in my opinion. Either way it is yours to do as you wish but seems pretty bad to me.

Also I do know for a fact this is just from pastebin, so I would recommend not using something you find from there. It is rather rude to just take someones code and use it as your own.

All of this is just my opinion so take it as you will.

BipolarDiZ is bipolar.
|:NxS:| Custom TTT Server: source.nxs-gaming.com:27015
|:NxS:| Vanilla TTT Server: source.nxs-gaming.com:27016
|:NxS:| Fretta: currently offline
moarx
Poster

Posts: 40


« Reply #2 on: March 01, 2012, 09:52:02 PM »

I'm pretty sure I've seen something like this working on a server though I can't remember which it was.
sniperduck
Poster

Posts: 178


|:NxS:| Staff! :D


« Reply #3 on: March 02, 2012, 01:47:30 AM »

I'm pretty sure I've seen something like this working on a server though I can't remember which it was.

Crowbar Gaming

Overtime these forums have made me an asshole. ;D (TTT subforum)
|:NxS:| Custom TTT Server: source.nxs-gaming.com:27016
|:NxS:| Vanilla TTT Server: source.nxs-gaming.com:27016
|:NxS:| Fretta: <COMING SOON>
SovietX
Poster

Posts: 52



« Reply #4 on: March 02, 2012, 03:38:17 AM »

Everything you do will always have a negative and positive effect. The cool feature with having a Defib type weapon is, yes you bring people back and yes it is a cool and unique feature but, this can cause issues such as dead players specing somebody and seeing them in a traitor room or with a traitor weapon etc etc. I would have to agree with BIP slightly on this. You can't please everybody, some people on my server love the idea, some people don't. It's just things that you have to decide when running your own TTT server.

Be the best by any means necessary
Senor Penguino
Poster

Posts: 6


« Reply #5 on: March 03, 2012, 06:13:13 PM »

This was from made for SourceTribe TTT, made by Jammie Dodger. Anybody/server who has that code, has stolen code.
BipolarDiZ
Poster

Posts: 101


|:NxS:| Staff! :D


« Reply #6 on: March 03, 2012, 08:46:14 PM »

Senor, it isn't hard to find it seeing as he put it on pastebin. Took a two second search to find it.

BipolarDiZ is bipolar.
|:NxS:| Custom TTT Server: source.nxs-gaming.com:27015
|:NxS:| Vanilla TTT Server: source.nxs-gaming.com:27016
|:NxS:| Fretta: currently offline
Tommynator
Poster

Posts: 173

Tommynator is a traitor!


« Reply #7 on: March 03, 2012, 09:39:05 PM »

http://pastebin.com/search?cx=partner-pub-4339714761096906%3A1qhz41g8k4m&cof=FORID%3A10&ie=UTF-8&q=weapon_tttbase&sa.x=0&sa.y=0
There you go :D

SovietX
Poster

Posts: 52



« Reply #8 on: March 04, 2012, 07:04:59 PM »

Senor was angry because I yelled at him for stealing tommynators hud that he made then claiming his guys made it, then telling me I don't give credits to _undefined who made pointshop which I don't even use :P. BTW Senor the file where the vtfs and vmts are is called Tommyhud, but I'm sure your guys made it, I don't have a problem that you took it, I only have a problem that you claimed to make it.
« Last Edit: March 04, 2012, 07:16:46 PM by SovietX »

Be the best by any means necessary
Pages: [1]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: TTT Defibrillator, can it be done? « previous next »
Jump to:  


Login with username, password and session length

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.011 seconds with 17 queries.