• [ERROR] Tommy228 / TTTDamagelogs
    2 replies, posted
I think everyone knows Tommy228 didn't work on the Damagelog anymore. Since a few updates i get this error: [CODE][ERROR] addons/ttt_damagelog/lua/damagelogs/sv_damagelog.lua:238: attempt to compare number with nil 1. fn - addons/ttt_damagelog/lua/damagelogs/sv_damagelog.lua:238 2. unknown - addons/ulib/lua/ulib/shared/hook.lua:110 3. FireBullets - [C]:-1 4. ShootBullet - gamemodes/terrortown/entities/weapons/weapon_tttbase.lua:318 5. PrimaryAttack - gamemodes/terrortown/entities/weapons/weapon_tttbase.lua:242 6. unknown - addons/ttt_damagelog/lua/damagelogs/sv_damageinfos.lua:46 [ERROR] addons/ttt_damagelog/lua/damagelogs/sv_damagelog.lua:238: attempt to compare number with nil 1. fn - addons/ttt_damagelog/lua/damagelogs/sv_damagelog.lua:238 2. unknown - addons/ulib/lua/ulib/shared/hook.lua:110 3. FireBullets - [C]:-1 4. ShootBullet - gamemodes/terrortown/entities/weapons/weapon_tttbase.lua:318 5. PrimaryAttack - gamemodes/terrortown/entities/weapons/weapon_tttbase.lua:242 6. oldprimary - gamemodes/terrortown/entities/weapons/weapon_zm_rifle.lua:59 7. unknown - addons/ttt_damagelog/lua/damagelogs/sv_damageinfos.lua:54[/CODE] here is the Code. [CODE]hook.Add("PlayerDeath", "Damagelog_PlayerDeathLastLogs", function(ply) if GetRoundState() == ROUND_ACTIVE and Damagelog.Time then local found_dmg = {} for k,v in ipairs(Damagelog.DamageTable) do if type(v) == "table" and v.time >= Damagelog.Time - 10 and v.time <= Damagelog.Time then -- <=== this is Line 238! table.insert(found_dmg, v) end end if not ply.DeathDmgLog then ply.DeathDmgLog = {} end ply.DeathDmgLog[Damagelog.CurrentRound] = found_dmg end end) if Damagelog.Use_MySQL then Damagelog.database:connect() end[/CODE] Did someone know a fix for this?
[QUOTE=UnDeadClank;50732240] Since a few updates i get this error: [CODE][ERROR] addons/ttt_damagelog/lua/damagelogs/sv_damagelog.lua:238: attempt to compare number with nil 1. fn - addons/ttt_damagelog/lua/damagelogs/sv_damagelog.lua:238 2. unknown - addons/ulib/lua/ulib/shared/hook.lua:110 3. FireBullets - [C]:-1 4. ShootBullet - gamemodes/terrortown/entities/weapons/weapon_tttbase.lua:318 5. PrimaryAttack - gamemodes/terrortown/entities/weapons/weapon_tttbase.lua:242 6. unknown - addons/ttt_damagelog/lua/damagelogs/sv_damageinfos.lua:46 [ERROR] addons/ttt_damagelog/lua/damagelogs/sv_damagelog.lua:238: attempt to compare number with nil 1. fn - addons/ttt_damagelog/lua/damagelogs/sv_damagelog.lua:238 2. unknown - addons/ulib/lua/ulib/shared/hook.lua:110 3. FireBullets - [C]:-1 4. ShootBullet - gamemodes/terrortown/entities/weapons/weapon_tttbase.lua:318 5. PrimaryAttack - gamemodes/terrortown/entities/weapons/weapon_tttbase.lua:242 6. oldprimary - gamemodes/terrortown/entities/weapons/weapon_zm_rifle.lua:59 7. unknown - addons/ttt_damagelog/lua/damagelogs/sv_damageinfos.lua:54[/CODE] here is the Code. [CODE]hook.Add("PlayerDeath", "Damagelog_PlayerDeathLastLogs", function(ply) if GetRoundState() == ROUND_ACTIVE and Damagelog.Time then local found_dmg = {} for k,v in ipairs(Damagelog.DamageTable) do if type(v) == "table" and v.time >= Damagelog.Time - 10 and v.time <= Damagelog.Time then -- <=== this is Line 238! table.insert(found_dmg, v) end end if not ply.DeathDmgLog then ply.DeathDmgLog = {} end ply.DeathDmgLog[Damagelog.CurrentRound] = found_dmg end end) if Damagelog.Use_MySQL then Damagelog.database:connect() end[/CODE] Did someone know a fix for this?[/QUOTE] Pretty difficult to help since we don't know what exact variable is causing the error but you could try: [code] hook.Add("PlayerDeath", "Damagelog_PlayerDeathLastLogs", function(ply) if GetRoundState() == ROUND_ACTIVE and Damagelog.Time then local found_dmg = {} for k,v in ipairs(Damagelog.DamageTable) do if type(v) == "table" and (v.time or 0) >= (Damagelog.Time or 0) - 10 and (v.time or 0) <= (Damagelog.Time or 0) then -- <=== this is Line 238! table.insert(found_dmg, v) end end if not ply.DeathDmgLog then ply.DeathDmgLog = {} end ply.DeathDmgLog[Damagelog.CurrentRound] = found_dmg end end) [/code]
Ok thanks!! Yeah, i know. But when this helps it would be nice.
Sorry, you need to Log In to post a reply to this thread.