I don't think that this code would work. In each queuecmd you use:
'est_killset %s %s' % (event_var['userid'], int(gungamelib.getPlayer(event_var['userid'])['level']))
But that will not work without errors.
%s is a wildcard for a string, not for an integer. So this line would be correct:
'est_killset %s %s' % (event_var['userid'], gungamelib.getPlayer(event_var['userid'])['level'])
Or you use
%i instead of
%s:
'est_killset %s %i' % (event_var['userid'], int(gungamelib.getPlayer(event_var['userid'])['level']))
Also, EventScripts allows you to set kills without ES_Tools (but not deaths). With ES, the command would be:
es.server.queuecmd('score set %s %s' % (event_var['userid'], gungamelib.getPlayer(event_var['userid'])['level']))
What I don't understand either: why do you only set the attackers kills back to the level value after a nade-kill? And why do you set the victims level again?
A working script should be:
'''
Title: gg_scoreboard
Version: 0.1
Description: shows gg level on scoreboard.
'''
# ==============================================================================
# IMPORTS
# ==============================================================================
# Python imports
import gamethread
# EventScripts imports
import es
# GunGame imports
import gungamelib
# ==============================================================================
# ADDON REGISTRATION
# ==============================================================================
# Register this addon with EventScripts
info = es.AddonInfo()
info.name = 'Scoreboard Addon for GunGame5'
info.version = '0.1'
info.url = ''
info.basename = 'gungame/custom_addons/gg_scoreboard'
info.author = 'addem1234 (modified by PitBull0993)'
# ==============================================================================
# GAME EVENTS
# ==============================================================================
def load():
gg_scoreboard = gungamelib.registerAddon('gg_scoreboard')
gg_scoreboard.setDisplayName('GG Scoreboard')
def unload():
gungamelib.unregisterAddon('gg_scoreboard')
def player_spawn(event_var):
es.server.queuecmd('score set %s %s' % (event_var['userid'], gungamelib.getPlayer(event_var['userid'])['level']))
def player_death(event_var):
gamethread.delayed(0.1, es.server.queuecmd, ('score set %s %s' % (event_var['attacker'], gungamelib.getPlayer(event_var['userid'])['level'])))
def gg_leveldown(event_var):
es.server.queuecmd('score set %s %s' % (event_var['userid'], event_var['new_level']))
def gg_levelup(event_var):
es.server.queuecmd('score set %s %s' % (event_var['userid'], event_var['new_level']))
Best Regards,
PitBull