Uhh, I have a few errors need fixed I don't have the time right now to look at them I'm going somewhere.
[B][ERROR] gamemodes/terrortown/entities/weapons/weapon_tttbase/shared.lua:308: Tried to use a NULL entity!
1. MuzzleFlash - [C]:-1
2. ShootBullet - gamemodes/terrortown/entities/weapons/weapon_tttbase/shared.lua:308
3. unknown - gamemodes/terrortown/entities/weapons/weapon_tttbase/shared.lua:247[/B]
[CODE]-- Custom weapon base, used to derive from CS one, still very similar
if SERVER then
AddCSLuaFile( "shared.lua" )
end
---- TTT SPECIAL EQUIPMENT FIELDS
-- This must be set to one of the WEAPON_ types in TTT weapons for weapon
-- carrying limits to work properly. See /gamemode/shared.lua for all possible
-- weapon categories.
SWEP.Kind = WEAPON_NONE
-- If CanBuy is a table that contains ROLE_TRAITOR and/or ROLE_DETECTIVE, those
-- players are allowed to purchase it and it will appear in their Equipment Menu
-- for that purpose. If CanBuy is nil this weapon cannot be bought.
-- Example: SWEP.CanBuy = { ROLE_TRAITOR }
-- (just setting to nil here to document its existence, don't make this buyable)
SWEP.CanBuy = nil
if CLIENT then
-- If this is a buyable weapon (ie. CanBuy is not nil) EquipMenuData must be
-- a table containing some information to show in the Equipment Menu. See
-- default equipment weapons for real-world examples.
SWEP.EquipMenuData = nil
-- Example data:
-- SWEP.EquipMenuData = {
--
---- Type tells players if it's a weapon or item
-- type = "Weapon",
--
---- Desc is the description in the menu. Needs manual linebreaks (via \n).
-- desc = "Text."
-- };
-- This sets the icon shown for the weapon in the DNA sampler, search window,
-- equipment menu (if buyable), etc.
SWEP.Icon = "VGUI/ttt/icon_nades" -- most generic icon I guess
-- You can make your own weapon icon using the template in:
-- /garrysmod/gamemodes/terrortown/template/
-- Open one of TTT's icons with VTFEdit to see what kind of settings to use
-- when exporting to VTF. Once you have a VTF and VMT, you can
-- resource.AddFile("materials/VGUI/...") them here. GIVE YOUR ICON A UNIQUE
-- FILENAME, or it WILL be overwritten by other servers! Gmod does not check
-- if the files are different, it only looks at the name. I recommend you
-- create your own directory so that this does not happen,
-- eg. /materials/VGUI/ttt/mycoolserver/mygun.vmt
end
---- MISC TTT-SPECIFIC BEHAVIOUR CONFIGURATION
-- ALL weapons in TTT must have weapon_tttbase as their SWEP.Base. It provides
-- some functions that TTT expects, and you will get errors without them.
-- Of course this is weapon_tttbase itself, so I comment this out here.
-- SWEP.Base = "weapon_tttbase"
-- If true AND SWEP.Kind is not WEAPON_EQUIP, then this gun can be spawned as
-- random weapon by a ttt_random_weapon entity.
SWEP.AutoSpawnable = false
-- Set to true if weapon can be manually dropped by players (with Q)
SWEP.AllowDrop = true
-- Set to true if weapon kills silently (no death scream)
SWEP.IsSilent = false
-- If this weapon should be given to players upon spawning, set a table of the
-- roles this should happen for here
-- SWEP.InLoadoutFor = { ROLE_TRAITOR, ROLE_DETECTIVE, ROLE_INNOCENT }
-- DO NOT set SWEP.WeaponID. Only the standard TTT weapons can have it. Custom
-- SWEPs do not need it for anything.
-- SWEP.WeaponID = nil
---- YE OLDE SWEP STUFF
if CLIENT then
SWEP.DrawCrosshair = false
SWEP.ViewModelFOV = 82
SWEP.ViewModelFlip = true
SWEP.CSMuzzleFlashes = true
end
SWEP.Base = "weapon_base"
SWEP.Category = "TTT"
SWEP.Spawnable = false
SWEP.AdminSpawnable = false
SWEP.IsGrenade = false
SWEP.Weight = 5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false
SWEP.Primary.Sound = Sound( "Weapon_Pistol.Empty" )
SWEP.Primary.Recoil = 1.5
SWEP.Primary.Damage = 1
SWEP.Primary.NumShots = 1
SWEP.Primary.Cone = 0.02
SWEP.Primary.Delay = 0.15
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = -1
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "none"
SWEP.Primary.ClipMax = -1
SWEP.Secondary.ClipSize = 1
SWEP.Secondary.DefaultClip = 1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.ClipMax = -1
SWEP.HeadshotMultiplier = 2.7
SWEP.StoredAmmo = 0
SWEP.IsDropped = false
SWEP.DeploySpeed = 1.4
SWEP.PrimaryAnim = ACT_VM_PRIMARYATTACK
SWEP.ReloadAnim = ACT_VM_RELOAD
AccessorFuncDT(SWEP, "ironsights", "Ironsights")
SWEP.fingerprints = {}
local sparkle = CLIENT and CreateConVar("ttt_crazy_sparks", "0", FCVAR_ARCHIVE)
-- crosshair
if CLIENT then
local sights_opacity = CreateConVar("ttt_ironsights_crosshair_opacity", "0.8", FCVAR_ARCHIVE)
local crosshair_brightness = CreateConVar("ttt_crosshair_brightness", "1.0", FCVAR_ARCHIVE)
local crosshair_size = CreateConVar("ttt_crosshair_size", "1.0", FCVAR_ARCHIVE)
local disable_crosshair = CreateConVar("ttt_disable_crosshair", "0", FCVAR_ARCHIVE)
function SWEP:DrawHUD()
local client = LocalPlayer()
if disable_crosshair:GetBool() or (not IsValid(client)) then return end
local sights = self:GetIronsights()
local x = ScrW() / 2.0
local y = ScrH() / 2.0
local scale = math.max(0.2, 10 * self:GetPrimaryCone())
local LastShootTime = self.Weapon:LastShootTime()
scale = scale * (2 - math.Clamp( (CurTime() - LastShootTime) * 5, 0.0, 1.0 ))
local alpha = sights and sights_opacity:GetFloat() or 1
local bright = crosshair_brightness:GetFloat() or 1
-- somehow it seems this can be called before my player metatable
-- additions have loaded
if client.IsTraitor and client:IsTraitor() then
surface.SetDrawColor(255 * bright,
50 * bright,
50 * bright,
255 * alpha)
else
surface.SetDrawColor(0,
255 * bright,
0,
255 * alpha)
end
local gap = 20 * scale * (sights and 0.8 or 1)
local length = gap + (25 * crosshair_size:GetFloat()) * scale
surface.DrawLine( x - length, y, x - gap, y )
surface.DrawLine( x + length, y, x + gap, y )
surface.DrawLine( x, y - length, x, y - gap )
surface.DrawLine( x, y + length, x, y + gap )
if self.HUDHelp then
self:DrawHelp()
end
end
local GetTranslation = LANG.GetTranslation
local GetPTranslation = LANG.GetParamTranslation
-- Many non-gun weapons benefit from some help
local help_spec = {text = "", font = "TabLarge", xalign = TEXT_ALIGN_CENTER}
function SWEP:DrawHelp()
local data = self.HUDHelp
local translate = data.translatable
local primary = data.primary
local secondary = data.secondary
if translate then
primary = primary and GetPTranslation(primary, data.translate_params)
secondary = secondary and GetPTranslation(secondary, data.translate_params)
end
help_spec.pos = {ScrW() / 2.0, ScrH() - 40}
help_spec.text = secondary or primary
draw.TextShadow(help_spec, 2)
-- if no secondary exists, primary is drawn at the bottom and no top line
-- is drawn
if secondary then
help_spec.pos[2] = ScrH() - 60
help_spec.text = primary
draw.TextShadow(help_spec, 2)
end
end
-- mousebuttons are enough for most weapons
local default_key_params = {
primaryfire = Key("+attack", "LEFT MOUSE"),
secondaryfire = Key("+attack2", "RIGHT MOUSE"),
usekey = Key("+use", "USE")
};
function SWEP:AddHUDHelp(primary_text, secondary_text, translate, extra_params)
extra_params = extra_para
[QUOTE=Vincii;43648378]Uhh, I have a few errors need fixed I don't have the time right now to look at them I'm going somewhere.[/QUOTE]
You are kidding right? You just left the error to us because you're going somewhere and don't have time to look into it yourself?
Too many errors, it is better to re-download gamemod
[url]http://github.com/garrynewman/garrysmod/tree/master/garrysmod/gamemodes/terrortown[/url]
[QUOTE=Svenskunganka;43651666]You are kidding right? You just left the error to us because you're going somewhere and don't have time to look into it yourself?[/QUOTE]
Yes, if I find out someone is in the fucking hospital I don't think i have the fucking time to look at it.
Sorry, you need to Log In to post a reply to this thread.