You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromplayers.entityimportPlayerEntityplayer_models=dict()
defmenu_callback(menu, index, option):
"""Called by a player selecting an option from the Models menu."""# Get a PlayerEntity instanceplayer=PlayerEntity(index)
# Tell what's happenedplayer.say('model changed to {0}'.format(option.value.name))
# Save what has been chosenplayer_models[player.userid] =option.value# Is the player alive and on a team?ifnotplayer.isdeadandnotplayer.dead_flagandplayer.team>1:
# If yes, change their model to the one chosenplayer.model=option.value.pathclass_Models(dict):
"""Extends dict to map models to Model instances by their basenames."""def__init__(self):
"""Called on instantiation."""# Call dict's constructorsuper(_Models, self).__init__()
# Create a PagedMenu instanceself._menu=PagedMenu(
select_callback=menu_callback,
title='{0}: Models'.format(info.name),
description='Choose a model below.'
)
# .........
raises the error as soon as I choose the first option I get when the menu is sent to me.
The text was updated successfully, but these errors were encountered:
This code:
raises the error as soon as I choose the first option I get when the menu is sent to me.
The text was updated successfully, but these errors were encountered: