I've been getting this error that occurs when the death kills a player or the player kills the death once theyve reached the end of the map. Here is the error:
[ERROR] lua/includes/modules/killicon.lua:69: 'CSKillIcons' isn't a valid font
1. SetFont - [C]:-1
2. GetSize - lua/includes/modules/killicon.lua:69
3. DrawDeath - gamemodes/base/gamemode/cl_deathnotice.lua:168
4. Run - gamemodes/base/gamemode/cl_deathnotice.lua:214
5. HUDPaint - gamemodes/base/gamemode/cl_init.lua:86
6. unknown - gamemodes/deathrun/gamemode/cl_init.lua:72
lua/includes/modules/killicon.lua
[CODE]-- DO NOT EDIT THIS FILE!
-- Globals that we need
local surface = surface
local Msg = Msg
local Color = Color
--[[---------------------------------------------------------
Name: killicon
Desc: Stores and serves killicons for deathnotice
-----------------------------------------------------------]]
module("killicon")
local Icons = {}
local TYPE_FONT = 0
local TYPE_TEXTURE = 1
function AddFont( name, font, character, color )
Icons[name] = {}
Icons[name].type = TYPE_FONT
Icons[name].font = font
Icons[name].character = character
Icons[name].color = color
end
function Add( name, material, color )
Icons[name] = {}
Icons[name].type = TYPE_TEXTURE
Icons[name].texture = surface.GetTextureID( material )
Icons[name].color = color
end
function AddAlias( name, alias )
Icons[name] = Icons[alias]
end
function Exists( name )
return Icons[name] != nil
end
function GetSize( name )
if (!Icons[name]) then
Msg("Warning: killicon not found '"..name.."'\n")
Icons[name] = Icons["default"]
end
local t = Icons[name]
-- Cached
if (t.size) then
return t.size.w, t.size.h
end
local w, h = 0
if ( t.type == TYPE_FONT ) then
surface.SetFont( t.font )
w, h = surface.GetTextSize( t.character )
end
if ( t.type == TYPE_TEXTURE ) then
-- Estimate the size from the size of the font
surface.SetFont( "HL2MPTypeDeath" )
w, h = surface.GetTextSize( "0" )
-- Fudge it slightly
h = h * 0.75
-- Make h/w 1:1
local tw, th = surface.GetTextureSize( t.texture )
w = tw * (h / th)
end
t.size = {}
t.size.w = w or 32
t.size.h = h or 32
return w, h
end
function Draw( x, y, name, alpha )
alpha = alpha or 255
if (!Icons[name]) then
Msg("Warning: killicon not found '"..name.."'\n")
Icons[name] = Icons["default"]
end
local t = Icons[name]
if ( !t.size ) then GetSize( name ) end
local w = t.size.w
local h = t.size.h
x = x - w * 0.5
if ( t.type == TYPE_FONT ) then
y = y - h * 0.1
surface.SetTextPos( x, y )
surface.SetFont( t.font )
surface.SetTextColor( t.color.r, t.color.g, t.color.b, alpha )
surface.DrawText( t.character )
end
if ( t.type == TYPE_TEXTURE ) then
y = y - h * 0.3
surface.SetTexture( t.texture )
surface.SetDrawColor( t.color.r, t.color.g, t.color.b, alpha )
surface.DrawTexturedRect( x, y, w, h )
end
end
--AddFont( "default", "HL2MPTypeDeath", "6", Color( 255, 240, 10, 255 ) )
local Color_Icon = Color( 255, 80, 0, 255 )
Add( "default", "HUD/killicons/default", Color_Icon )
AddAlias( "suicide", "default" )
[/CODE]
gamemodes/base/gamemode/cl_deathnotice.lua
[CODE]local hud_deathnotice_time = CreateConVar( "hud_deathnotice_time", "6", FCVAR_REPLICATED, "Amount of time to show death notice" )
-- These are our kill icons
local Color_Icon = Color( 255, 80, 0, 255 )
local NPC_Color = Color( 250, 50, 50, 255 )
killicon.AddFont( "prop_physics", "HL2MPTypeDeath", "9", Color_Icon )
killicon.AddFont( "weapon_smg1", "HL2MPTypeDeath", "/", Color_Icon )
killicon.AddFont( "weapon_357", "HL2MPTypeDeath", ".", Color_Icon )
killicon.AddFont( "weapon_ar2", "HL2MPTypeDeath", "2", Color_Icon )
killicon.AddFont( "crossbow_bolt", "HL2MPTypeDeath", "1", Color_Icon )
killicon.AddFont( "weapon_shotgun", "HL2MPTypeDeath", "0", Color_Icon )
killicon.AddFont( "rpg_missile", "HL2MPTypeDeath", "3", Color_Icon )
killicon.AddFont( "npc_grenade_frag", "HL2MPTypeDeath", "4", Color_Icon )
killicon.AddFont( "weapon_pistol", "HL2MPTypeDeath", "-", Color_Icon )
killicon.AddFont( "prop_combine_ball", "HL2MPTypeDeath", "8", Color_Icon )
killicon.AddFont( "grenade_ar2", "HL2MPTypeDeath", "7", Color_Icon )
killicon.AddFont( "weapon_stunstick", "HL2MPTypeDeath", "!", Color_Icon )
killicon.AddFont( "npc_satchel", "HL2MPTypeDeath", "*", Color_Icon )
killicon.AddFont( "npc_tripmine", "HL2MPTypeDeath", "*", Color_Icon )
killicon.AddFont( "weapon_crowbar", "HL2MPTypeDeath", "6", Color_Icon )
killicon.AddFont( "weapon_physcannon", "HL2MPTypeDeath", ",", Color_Icon )
local Deaths = {}
local function PlayerIDOrNameToString( var )
if ( type( var ) == "string" ) then
if ( var == "" ) then return "" end
return "#"..var
end
local ply = Entity( var )
if ( !IsValid( ply ) ) then return "NULL!" end
return ply:Name()
end
local function RecvPlayerKilledByPlayer( message )
local victim = message:ReadEntity();
local inflictor = message:ReadString();
local attacker = message:ReadEntity();
if ( !IsValid( attacker ) ) then return end
if ( !IsValid( victim ) ) then return end
GAMEMODE:AddDeathNotice( attacker:Name(), attacker:Team(), inflictor, victim:Name(), victim:Team() )
end
usermessage.Hook( "PlayerKilledByPlayer", RecvPlayerKilledByPlayer )
local function RecvPlayerKilledSelf( message )
local victim = message:ReadEntity();
if ( !IsValid( victim ) ) then return end
GAMEMODE:AddDeathNotice( nil, 0, "suicide", victim:Name(), victim:Team() )
end
usermessage.Hook( "PlayerKilledSelf", RecvPlayerKilledSelf )
local function RecvPlayerKilled( message )
local victim = message:ReadEntity();
if ( !IsValid( victim ) ) then return end
local inflictor = message:ReadString();
local attacker = "#" .. message:ReadString();
GAMEMODE:AddDeathNotice( attacker, -1, inflictor, victim:Name(), victim:Team() )
end
usermessage.Hook( "PlayerKilled", RecvPlayerKilled )
local function RecvPlayerKilledNPC( message )
local victimtype = message:ReadString();
local victim = "#" .. victimtype;
local inflictor = message:ReadString();
local attacker = message:ReadEntity();
--
-- For some reason the killer isn't known to us, so don't proceed.
--
if ( !IsValid( attacker ) ) then return end
GAMEMODE:AddDeathNotice( attacker:Name(), attacker:Team(), inflictor, victim, -1 )
local bIsLocalPlayer = (IsValid(attacker) && attacker == LocalPlayer())
local bIsEnemy = IsEnemyEntityName( victimtype )
local bIsFriend = IsFriendEntityName( victimtype )
if ( bIsLocalPlayer && bIsEnemy ) then
achievements.IncBaddies();
end
if ( bIsLocalPlayer && bIsFriend ) then
achievements.IncGoodies();
end
if ( bIsLocalPlayer && (!bIsFriend && !bIsEnemy) ) then
achievements.IncBystander();
end
end
usermessage.Hook( "PlayerKilledNPC", RecvPlayerKilledNPC )
local function RecvNPCKilledNPC( message )
local victim = "#" .. message:ReadString();
local inflictor = message:ReadString();
local attacker = "#" .. message:ReadString();
GAMEMODE:AddDeathNotice( attacker, -1, inflictor, victim, -1 )
end
usermessage.Hook( "NPCKilledNPC", RecvNPCKilledNPC )
--[[---------------------------------------------------------
Name: gamemode:AddDeathNotice( Victim, Attacker, Weapon )
Desc: Adds an death notice entry
-----------------------------------------------------------]]
function GM:AddDeathNotice( Victim, team1, Inflictor, Attacker, team2 )
local Death = {}
Death.victim = Victim
Death.attacker = Attacker
Death.time = CurTime()
Death.left = Victim
Death.right = Attacker
Death.icon = Inflictor
if ( team1 == -1 ) then Death.color1 = table.Copy( NPC_Color )
else Death.color1 = table.Copy( team.GetColor( team1 ) ) end
if ( team
The weapon you are using to kill death is not set up properly and either does not have a kill icon or is using the old version which did not have tables.
Either that or it is called wrong.
[QUOTE=Fortune11709;43626432]The weapon you are using to kill death is not set up properly and either does not have a kill icon or is using the old version which did not have tables.[/QUOTE]
I kill him with the default crowbar. What could I do to set it up properly?
[QUOTE=Fortune11709;43626606]In your death notice code, you have this:
[CODE]
killicon.AddFont( "prop_physics", "HL2MPTypeDeath", "9", Color_Icon )
killicon.AddFont( "weapon_smg1", "HL2MPTypeDeath", "/", Color_Icon )
killicon.AddFont( "weapon_357", "HL2MPTypeDeath", ".", Color_Icon )
killicon.AddFont( "weapon_ar2", "HL2MPTypeDeath", "2", Color_Icon )
killicon.AddFont( "crossbow_bolt", "HL2MPTypeDeath", "1", Color_Icon )
killicon.AddFont( "weapon_shotgun", "HL2MPTypeDeath", "0", Color_Icon )
killicon.AddFont( "rpg_missile", "HL2MPTypeDeath", "3", Color_Icon )
killicon.AddFont( "npc_grenade_frag", "HL2MPTypeDeath", "4", Color_Icon )
killicon.AddFont( "weapon_pistol", "HL2MPTypeDeath", "-", Color_Icon )
killicon.AddFont( "prop_combine_ball", "HL2MPTypeDeath", "8", Color_Icon )
killicon.AddFont( "grenade_ar2", "HL2MPTypeDeath", "7", Color_Icon )
killicon.AddFont( "weapon_stunstick", "HL2MPTypeDeath", "!", Color_Icon )
killicon.AddFont( "npc_satchel", "HL2MPTypeDeath", "*", Color_Icon )
killicon.AddFont( "npc_tripmine", "HL2MPTypeDeath", "*", Color_Icon )
killicon.AddFont( "weapon_crowbar", "HL2MPTypeDeath", "6", Color_Icon )
killicon.AddFont( "weapon_physcannon", "HL2MPTypeDeath", ",", Color_Icon )[/CODE]
Change them to the proper format.[/QUOTE]
Sorry, a bit of a lua noob. What is the proper format for death notices?
This is the line that is actually giving you an error:
[CODE]self.BaseClass:HUDPaint()[/CODE]
Line 72 of your DeathRun client init.
Excuse my previous posts I was thinking of something else.
It sounds like you have set the base of your gamemode.
Can I see your shared lua file?
[QUOTE=Fortune11709;43626788]This is the line that is actually giving you an error:
[CODE]self.BaseClass:HUDPaint()[/CODE]
Line 72 of your DeathRun client init.
Excuse my previous posts I was thinking of something else.
It sounds like you have set the base of your gamemode.
Can I see your shared lua file?[/QUOTE]
[CODE]DeriveGamemode( "base" )
function GM:CreateTeams()
TEAM_DEATH = 2
team.SetUp( TEAM_DEATH, "Death", Color( 180, 60, 60, 255 ), false )
team.SetSpawnPoint( TEAM_DEATH, "info_player_terrorist" )
TEAM_RUNNER = 3
team.SetUp( TEAM_RUNNER, "Runner", Color( 60, 60, 180, 255 ), false )
team.SetSpawnPoint( TEAM_RUNNER, "info_player_counterterrorist" )
team.SetUp( TEAM_SPECTATOR, "Spectator", Color( 125, 125, 125, 255 ), true )
end
local meta = FindMetaTable( "Player" )
function GM:PhysgunPickup( ply, ent )
if not ply:IsSuperAdmin() then return false end
if not IsValid(ent) then return false end
if not ent:IsWeapon() then return false end
return true
end
function GM:PlayerNoClip( ply, on )
if not ply:IsAdmin() then return false end
if SERVER then
PrintMessage( HUD_PRINTCONSOLE, "Admin '"..ply:Nick().."' has "..(on and "enabled" or "disabled").." noclip." )
end
return true
end
function GM:PlayerUse( ply )
if not ply:Alive() then return false end
return true
end
function GM:GetRound()
return GetGlobalInt( "Deathrun_RoundPhase" )
end
function GM:GetRoundTime()
return math.Round(math.max( GetGlobalInt( "Deathrun_RoundTime" ) - CurTime(), 0 ))
end
meta.OldAlive = meta.OldAlive or meta.Alive
function meta:Alive()
if self:Team() == TEAM_SPECTATOR then return false end
return self:OldAlive()
end
-- Thanks BlackAwps!
function string.FormattedTime( seconds, Format )
if not seconds then seconds = 0 end
local hours = math.floor(seconds / 3600)
local minutes = math.floor((seconds / 60) % 60)
local millisecs = ( seconds - math.floor( seconds ) ) * 100
seconds = seconds % 60
if Format then
return string.format( Format, minutes, seconds, millisecs )
else
return { h=hours, m=minutes, s=seconds, ms=millisecs }
end
end
-- Credit: AzuiSleet
-- maybe.
-- It's old, I don't remember who made it. 90% sure it was AzuiSleet.
function GM:Move(pl, movedata)
if pl:IsOnGround() or !pl:Alive() or pl:WaterLevel() > 0 then return end
local aim = movedata:GetMoveAngles()
local forward, right = aim:Forward(), aim:Right()
local fmove = movedata:GetForwardSpeed()
local smove = movedata:GetSideSpeed()
forward.z, right.z = 0,0
forward:Normalize()
right:Normalize()
local wishvel = forward * fmove + right * smove
wishvel.z = 0
local wishspeed = wishvel:Length()
if(wishspeed > movedata:GetMaxSpeed()) then
wishvel = wishvel * (movedata:GetMaxSpeed()/wishspeed)
wishspeed = movedata:GetMaxSpeed()
end
local wishspd = wishspeed
wishspd = math.Clamp(wishspd, 0, 30)
local wishdir = wishvel:GetNormal()
local current = movedata:GetVelocity():Dot(wishdir)
local addspeed = wishspd - current
if(addspeed <= 0) then return end
local accelspeed = (120) * wishspeed * FrameTime()
if(accelspeed > addspeed) then
accelspeed = addspeed
end
local vel = movedata:GetVelocity()
vel = vel + (wishdir * accelspeed)
movedata:SetVelocity(vel)
return false
end[/CODE]
This happens a lot, but usually it doesn't involve crashing clients or servers. I think your crashing is something else.
Sorry, you need to Log In to post a reply to this thread.