Code: Select all
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\packages\source-python\commands\auth.py", line 44, in __call__
return self.callback(*args)
File "..\addons\source-python\packages\source-python\menus\queue.py", line 267, in _menuselect_callback
_radio_queues[index]._select(choice)
File "..\addons\source-python\packages\source-python\menus\queue.py", line 126, in _select
next_menu = active_menu._select(self._index, choice)
File "..\addons\source-python\packages\source-python\menus\radio.py", line 113, in _select
self._player_pages[player_index].options[choice_index])
File "..\addons\source-python\packages\source-python\menus\base.py", line 126, in _select
return self.select_callback(self, player_index, choice_index)
File "..\addons\source-python\plugins\rpg\modules\admin\__init__.py", line 749, in log_choice_menu_callback
f = open(_logs.joinpath(steamid), 'r', encoding="utf8")
AttributeError: 'str' object has no attribute 'joinpath'
In linux this code works fine, but at windows it have issue
Syntax: Select all
def log_choice_menu_callback(_menu, _index, _option):
choice = _option.value
if choice:
userid = rpglib.useridFromIndex(_index)
if rpg.SOUND_SELECT:
rpglib.playgamesound(userid, rpg.SOUND_SELECT)
if choice == 'view':
steamid = rpg.players[userid]['log']
f = open(_logs.joinpath(steamid), 'r', encoding="utf8")
console_message(userid, ' ')
console_message(userid, '******************* LOG START *******************')
console_message(userid, ' ')
for i in f.readlines():
console_message(userid, '%s' % (i.replace('\n', '').replace('\r', '')))
f.close()
console_message(userid, ' ')
console_message(userid, '******************* LOG END *******************')
rpglib.tell(userid, '\x04Log %s has been printed to your console' % (steamid))