• Print

Author Topic: These errors?  (Read 5400 times)

0 Members and 1 Guest are viewing this topic.

Offline Kossan

  • Newbie
  • *
  • Posts: 21
  • Karma: -7
These errors?
« on: May 20, 2014, 09:50:44 am »
Hi, my server have got these errors sometimes could some1 please help me sort out what it is? And my server prob dies of it, And i dont know but my TTT preround safe is off. What i mean is the preround to find guns is off you can kill each other in preround in my TTT could some1 help me? And heres the errors that comes up

[ERROR] lua/autorun/server/ttt_perky_server.lua:30: attempt to call method 'GetClass' (a nil value)
 1. fn - lua/autorun/server/ttt_perky_server.lua:30
 2. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
 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/damagelog-master/lua/sv_damageinfos.lua:26

ERROR] lua/autorun/server/ttt_perky_server.lua:30: attempt to call method 'GetClass' (a nil value)
 1. fn - lua/autorun/server/ttt_perky_server.lua:30
 2. unknown - addons/ulib/lua/ulib/shared/hook.lua:183

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: These errors?
« Reply #1 on: May 20, 2014, 09:53:55 am »
Get rid of ttt_perky_server. It's a buggy addon.
Out of the Garry's Mod business.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2727
  • Karma: 430
    • |G4P| Gman4President
Re: These errors?
« Reply #2 on: May 20, 2014, 11:23:28 am »
It's not so much a fix as an addition.

You would have to write a function using one of the TTT hooks that disabled damage.

Check out this GameMode hook: http://wiki.garrysmod.com/page/GM/EntityTakeDamage
You would need to check the round state.


Try this: (UNTESTED)

Code: Lua
  1. function TTT_NoDamageOutsideRound( ply, dmginfo )
  2.         if GAMEMODE.round_state ~= ROUND_ACTIVE then
  3.                 dmginfo:ScaleDamage(0)
  4.                 return dmginfo
  5.         end
  6. end
  7. hook.Add( "EntityTakeDamage", "TTT_NoDamageOutsideRound", TTT_NoDamageOutsideRound )
  8.  

Place that in a file called ttt_nodamage.lua in your garrysmod/lua/autorun/server folder.

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: These errors?
« Reply #3 on: May 20, 2014, 11:38:01 am »
I believe TTT already disables preround damage by default: https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/terrortown/gamemode/player.lua#L877
So something must be overriding it one way or another?
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: These errors?
« Reply #4 on: May 20, 2014, 12:02:39 pm »
There's a function in the turret code that enables damage to players preround.
I remember seeing this issue on TTT forums.
Out of the Garry's Mod business.

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: These errors?
« Reply #5 on: May 20, 2014, 01:02:33 pm »
There's a function in the turret code that enables damage to players preround.
I remember seeing this issue on TTT forums.
Ah, that makes sense.
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

  • Print