因为有一些命令,如tempban、permban等,这些命令可以通过配置文件管理器下的ptokax为配置文件授予权限。
我已经编写了一个脚本,我想将我的命令添加到GUI中。我该怎么做?
发布于 2014-06-09 12:25:18
不,您不能允许某些配置文件使用您编写或创建的命令。相反,您必须通过自己的脚本来处理这个问题。例如,假设您拥有从0 (主用户)到6 (常规用户)的配置文件级别,以及未注册用户的配置文件-1。
如果只希望某些配置文件可以访问命令,请创建一个哈希表:
tAllowedProfiles = {
[-1] = false,
[0] = true,
[1] = false,
[2] = false,
[3] = true,
[4] = true,
[5] = true,
[6] = false
}然后,在ChatArrival或ToArrival函数中,可以将用户的配置文件与上面创建的has表匹配:
function ChatArrival( tUser, sMessage )
if not tAllowedProfiles[tUser.iProfile] then return false end
-- deal with the command/message otherwise
end对于Windows的GUI客户端也是如此。您可以查看一些我自己的剧本供参考。
https://stackoverflow.com/questions/24119829
复制相似问题