这是我的Python代码:import es, popuplib, cmdlib

info = es.AddonInfo()

info['name'] = "bilbodog Vaaben Menu"

info['version'] = "1.1"

info['author'] = "bilbodog"

info['url'] = ""

info['description'] = "En vaaben menu der kan give vaaben til spillere"

def load():

es.regclientcmd('bm_version', 'bm/bm_version')

cmdlib.registerSayCommand('!wpa', sendBmMenu, 'Send BM Menu')

es.msg('#multi', '#green[bilbodog Vaaben Menu] #defaultblev loaded!')

global bilbodog, bilbodogSelf, bilbodogOther, bilbodogSelf2, bilbodogSelf3, bilbodogSelf4, bilbodogSelf5, bilbodogSelf6, bilbodogSelf7, bilbodogSelf8, bilbodogSelf9, bilbodogOther2, bilbodogOther3, bilbodogOther4, bilbodogOther5, bilbodogOther6, bilbodogOther7, bilbodogOther8, bilbodogOther9, bilbodogadmins

bilbodogadmins = ('STEAM_0:1:25150824', 'STEAM_ID_LAN', 'STEAM_ID_PENDING')

bilbodog = popuplib.create('bilbodog')

bilbodog.addline('---------------bilbodog Vaaben Menu---------------')

bilbodog.addline('Weapon Menu - Hvem vil De give et vaaben?')

bilbodog.addline('->1. Mig selv')

bilbodog.addline('->2. Andre spillere')

bilbodog.addline('------------------------------')

bilbodog.addline('0 Luk')

bilbodog.menuselect = bilbodogscript

bilbodogSelf = popuplib.create('bilbodogSelf')

bilbodogSelf.addline('---------------bilbodog Vaaben Menu---------------')

bilbodogSelf.addline('Weapon Menu - Mig selv')

bilbodogSelf.addline('->1. Haandpistoler')

bilbodogSelf.addline('->2. Stormgevaerer')

bilbodogSelf.addline('->3. Haglgevaerer')

bilbodogSelf.addline('->4. Maskinepistoler')

bilbodogSelf.addline('->5. Sniper Vaaben')

bilbodogSelf.addline('->6. Maskingevaer')

bilbodogSelf.addline('->7. Udstyr')

bilbodogSelf.addline('->8. Vaaben Saet')

bilbodogSelf.addline('------------------------------')

bilbodogSelf.addline('0 Luk')

bilbodogSelf.menuselect = bilbodogSelfscript

bilbodogSelf2 = popuplib.create('bilbodogSelf2')

bilbodogSelf2.addline('---------------bilbodog Vaaben Menu---------------')

bilbodogSelf2.addline('Weapon Menu - Mig selv - Haandpistoler')

bilbodogSelf2.addline('->1.G18')

bilbodogSelf2.addline('->2.USP45')

bilbodogSelf2.addline('->3.P228')

bilbodogSelf2.addline('->4.Desert Eagle')

bilbodogSelf2.addline('->5.Five-Seven')

bilbodogSelf2.addline('->6.Dual Elite')

bilbodogSelf2.addline('------------------------------')

bilbodogSelf2.addline('->8.Tilbage')

bilbodogSelf2.addline('0.Luk')

bilbodogSelf2.menuselect = bilbodogSelf2script

# ...SNIP...

bilbodogSelf9 = popuplib.create('bilbodogSelf9')

bilbodogSelf9.addline('---------------bilbodog Vaaben Menu---------------')

bilbodogSelf9.addline('Weapon Menu - Mig selv - Udstyr')

bilbodogSelf9.addline('->1.M4A1, Deagle, Nades, Armor')

bilbodogSelf9.addline('->2.M4A1, Elite, Nades, Armor')

bilbodogSelf9.addline('->3.AK47, Deagle, Nades, Armor')

bilbodogSelf9.addline('->4.AK47, Elite, Nades, Armor')

bilbodogSelf9.addline('->5.AWP, Deagle, Nades, Armor')

bilbodogSelf9.addline('->6.AWP, Elite, Nades, Armor')

bilbodogSelf9.addline('------------------------------')

bilbodogSelf9.addline('->8.Tilbage')

bilbodogSelf9.addline('0.Luk')

bilbodogSelf9.menuselect = bilbodogSelf9script

bilbodogOther = popuplib.create('bilbodogOther')

bilbodogOther.addline('---------------bilbodog Vaaben Menu---------------')

bilbodogOther.addline('Weapon Menu - Andre spillere')

bilbodogOther.addline('->1. Haandpistoler')

bilbodogOther.addline('->2. Stormgevaerer')

bilbodogOther.addline('->3. Haglgevaerer')

bilbodogOther.addline('->4. Maskinepistoler')

bilbodogOther.addline('->5. Sniper Vaaben')

bilbodogOther.addline('->6. Maskingevaer')

bilbodogOther.addline('->7. Udstyr')

bilbodogOther.addline('->8. Vaaben Saet')

bilbodogOther.addline('------------------------------')

bilbodogOther.addline('0 Luk')

bilbodogOther.menuselect = bilbodogOtherscript

bilbodogOther2 = popuplib.create('bilbodogOther2')

bilbodogOther2.addline('---------------bilbodog Vaaben Menu---------------')

bilbodogOther2.addline('Weapon Menu - Andre spillere - Haandpistoler')

bilbodogOther2.addline('->1.G18')

bilbodogOther2.addline('->2.USP45')

bilbodogOther2.addline('->3.P228')

bilbodogOther2.addline('->4.Desert Eagle')

bilbodogOther2.addline('->5.Five-Seven')

bilbodogOther2.addline('->6.Dual Elite')

bilbodogOther2.addline('------------------------------')

bilbodogOther2.addline('->8.Tilbage')

bilbodogOther2.addline('0.Luk')

bilbodogOther2.menuselect = bilbodogOther2script

# ...SNIP...

bilbodogOther9 = popuplib.create('bilbodogOther9')

bilbodogOther9.addline('---------------bilbodog Vaaben Menu---------------')

bilbodogOther9.addline('Weapon Menu - Andre spillere - Udstyr')

bilbodogOther9.addline('->1.M4A1, Deagle, Nades, Armor')

bilbodogOther9.addline('->2.M4A1, Elite, Nades, Armor')

bilbodogOther9.addline('->3.AK47, Deagle, Nades, Armor')

bilbodogOther9.addline('->4.AK47, Elite, Nades, Armor')

bilbodogOther9.addline('->5.AWP, Deagle, Nades, Armor')

bilbodogOther9.addline('->6.AWP, Elite, Nades, Armor')

bilbodogOther9.addline('------------------------------')

bilbodogOther9.addline('->8.Tilbage')

bilbodogOther9.addline('0.Luk')

bilbodogOther9.menuselect = bilbodogOther9script

def sendBmMenu(userid, args):

steam = es.getplayersteamid(userid)

if steam in bilbodogadmins:

bilbodog.send(userid)

else:

es.tell(event_var['userid'], '#multi', '#greenDe har ikke adgang til denne kommando!')

def bilbodogscript(userid, choice, popupid):

if choice == 1:

bilbodogSelf.send(userid)

elif choice == 2:

bilbodogOther.send(userid)

def bilbodogSelfscript(userid, choice, popupid):

if choice == 1:

bilbodogSelf2.send(userid)

elif choice == 2:

bilbodogSelf3.send(userid)

elif choice == 3:

bilbodogSelf4.send(userid)

elif choice == 4:

bilbodogSelf5.send(userid)

elif choice == 5:

bilbodogSelf6.send(userid)

elif choice == 6:

bilbodogSelf7.send(userid)

elif choice == 7:

bilbodogSelf8.send(userid)

elif choice == 8:

bilbodogSelf9.send(userid)

def bilbodogOtherscript(userid, choice, popupid):

if choice == 1:

bilbodogOther2.send(userid)

elif choice == 2:

bilbodogOther3.send(userid)

elif choice == 3:

bilbodogOther4.send(userid)

elif choice == 4:

bilbodogOther5.send(userid)

elif choice == 5:

bilbodogOther6.send(userid)

elif choice == 6:

bilbodogOther7.send(userid)

elif choice == 7:

bilbodogOther8.send(userid)

elif choice == 8:

bilbodogOther9.send(userid)

def bm_version():

es.msg('#multi', '#green[bilbodog Vaaben Menu] #defaultVersion 1.0')

es.msg('#multi', '#green[bilbodog Vaaben Menu] #defaultLavet af bilbodog')

def unload():

cmdlib.unregisterSayCommand('!wpa')

我收到一个错误:NameError: global name 'bilbodogOther' is not not defined

错误就发生在这里:def bilbodogscript(userid, choice, popupid):

if choice == 1:

bilbodogSelf.send(userid)

elif choice == 2:

bilbodogOther.send(userid)

但我不明白,这是什么意思?

python name is not defined_PythonNameError: global name 'NAME' is not not defined这个问题怎么解决?...相关推荐

  1. python全局变量(模块法和global)

    python全局变量(模块法和global) python中全局变量使用,一般有两种方法,使用global和使用模块 global 在python中,可以使用global声明一个变量为全局变量 1. ...

  2. python中引入包的时候报错AttributeError: module ‘sys‘ has no attribute ‘setdefaultencoding‘解决方法?

    python中引入包的时候报错AttributeError: module 'sys' has no attribute 'setdefaultencoding'解决方法? 参考文章: (1)pyth ...

  3. Python中 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape错误解决方法

    Python中 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape错误解决方法: ...

  4. Python使用pip安装报错ModuleNotFoundError: No module named ‘pip._internal.cli.main‘的解决方法

    Python使用pip安装报错ModuleNotFoundError: No module named 'pip._internal.cli.main'的解决方法   大家好,我叫亓官劼(qí guā ...

  5. python爬虫selenium爬不到frame 的tag标记下#document==0的内容解决

    python爬虫selenium爬不到frame 的tag标记下#document==0的内容解决 前言 按理来说,selenium可以获取当前页面的所有源代码,但却爬不到frame 的tag标记下# ...

  6. Python:OSError [WinError 123] 文件名、目录名或卷标语法不正确。解决方法。

    Python:OSError: [WinError 123] 文件名.目录名或卷标语法不正确.解决方法. 我的错误代码: folder = "D:\aatest" files = ...

  7. 运行python脚本时,报错InsecurePlatformWarning: A true SSLContext object is not available,解决方法

    运行python脚本时,报错InsecurePlatformWarning: A true SSLContext object is not available,解决方法 参考文章: (1)运行pyt ...

  8. python函数 global_**Python的函数参数传递 和 global

    函数的参数到底是传递的一份复制的值,还是对内存的引用? 我们看下面一段代码: a = [] def fun(x): x.append(1) fun(a) print(a) 想想一下:如果传递的是一份复 ...

  9. python nonlocal的用法_python global和nonlocal用法解析

    这篇文章主要介绍了python global和nonlocal用法解析,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下 ◆global和nonloca ...

最新文章

  1. Shadow mapping
  2. python长度分割文本_python 按照固定长度分割字符串的方法小结
  3. 迁移学习之域自适应理论简介(Domain Adaptation Theory)
  4. 人工神经网络之激活函数总结
  5. 20.MySQL 常用命令
  6. c语言随机数猜数游戏
  7. 教你轻松查看QQ空间加密后的好友图片
  8. 传递函数化为状态空间表达式
  9. 大模型系统和应用——Transformer预训练语言模型
  10. 如何自己学习51单片机
  11. 新趋势:区块链引领游戏行业发展
  12. Oracle数据库之子程序和包(八)
  13. FineBI连接本地Mysql数据库
  14. SpringMVC总结(动力节点荣姐)
  15. 4月6日—4月10日三年级课程
  16. 敏捷漫画#认知负荷与团队拓扑
  17. 微信小程序-复制到剪切板
  18. Deep Learning for Depression Recognition with Audiovisual Cues: A Review
  19. 盐港中学计算机应用,深圳市盐港中学
  20. iOS设备数据恢复软件Apeaksoft iOS Toolkit Mac

热门文章

  1. 解决 EF whereT(func) 查询的一个性能问题
  2. ORACLE限制IP访问数据库
  3. 比特币现金一周年:BCH地位几何?
  4. 微软支持BCH支付方式 曾三次暂停BTC支付
  5. 什么是第三方物流管理?如何套用模板进行绘制
  6. 44、【华为HCIE-Storage】--InfoEqualizer
  7. 张勇:做一个透明经济体的CEO
  8. 基本CSS选择器,复合选择器,后代选择器
  9. DOS之BAT批处理文件语法3(转)
  10. 下一代防火墙的5个优点