You are not logged in.

Dear visitor, welcome to sourceserver.info. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Bosnien_Fighter

Unregistered

1

Friday, June 28th 2013, 10:52pm

Kann mir wer helfen :/? Plugin/Scripten

Hallo,

brauche hilfe bei einem Menü
möchte gern hier bei dem Menü eine weitere Auswahl dazugeben.
Im moment sind nur 2 da : Rules und Admins
möchte da noch Event und VIP dazu haben!

Möchte hald das bei Event sich wie bei "Rules" eine neue Seite öffnet
und ich da dann die nächten Events eintrage und dann unten was man
gewinnt.
Und bei VIP möchte ich auch das eine seite noch kommt und
das ich da eintragen kann VIP-Shop eine auswähl ,und die zweite VIP-List

Wie mache ich das :/ ,kann mir da wer helfen ? oder iwer das umschreiben ,das währe echt sehr nett :rolleyes:



Quoted

# CheeTaH: Rules & Admin

# Add admins/rules in the admins_and_rules.txt file, should be in the same folder as this file.

# CONFIG #
# CONFIG #
# Send crules/admins menu when a player connects?
crules_send_on_connect = 1
# If crules_send_on_connect is enabled the menu will be sent on connect.
# Here you can change after how much time, the menu will be sent (seconds)
crules_timer = 5
# These aer the commands that will open the menu.
# They must be lower cased!
# Add as many as you want
Activators = ('!admins','!members','!owner','!rules','!regler','!reglen','!info')

# CONFIG DONE - Editing more might cause script to not work!
# CONFIG DONE - Editing more might cause script to not work!

import es
import gamethread
import popuplib
import playerlib

variables = [["crules_version","v1.6CheeTaH","Script version.",1],]

FileToRead_Admins = []
FileToRead_Rules = []
FileToRead_ = open(es.getAddonPath('crules') + '/admins_and_rules.txt').readlines()
for Line in FileToRead_:
if Line.startswith("|Add Rule|"):
LineSplit = Line.split("|")
if len(LineSplit) == 5:
FileToRead_Rules.append(LineSplit[2:4])
elif Line.startswith("|Add Admin|"):
LineSplit = Line.split("|")
if len(LineSplit) == 6:
FileToRead_Admins.append(LineSplit[2:5])
def load():
SetUpVars()
es.msg('#multi','#green[CheeTaH Rules \x05%s#green] #defaultLoaded' %(str(es.ServerVar("crules_version")).strip("CheeTaH")))
global crules_main
crules_main = popuplib.easymenu('crules_main',None, SendMenu)
crules_main.settitle("- CRules \n-- Main Menu")
crules_main.addoption('crules_rules_main', 'Rules')
crules_main.addoption('crules_admins_main', 'Admins')
global crules_rules_main
crules_rules_main = popuplib.easymenu('crules_rules_main',None, SendMenu)
crules_rules_main.settitle("- CRules \n-- Rules")
crules_rules_main.submenu(10, crules_main)
global crules_admins_main
crules_admins_main = popuplib.easymenu('crules_admins_main',None, SendMenu)
crules_admins_main.settitle("- CRules \n-- Admins")
crules_admins_main.submenu(10, crules_main)
AdminsCategorys = {}
for Line in FileToRead_Rules:
if Line[0] not in AdminsCategorys: AdminsCategorys[Line[0]] = Line[0]
for cat in sorted(AdminsCategorys.keys()):
crules_rules_main.addoption("crules_rules__%s" %cat,cat)
AddRule(cat)
AdminsCategorys = {}
for Line in FileToRead_Admins:
if Line[0] not in AdminsCategorys: AdminsCategorys[Line[0]] = Line[0]
for cat in sorted(AdminsCategorys.keys()):
crules_admins_main.addoption("crules_admins__%s" %cat,cat)
def unload():
es.msg('#multi','#green[CheeTaH Rules \x05%s#green] #defaultLoaded' %(str(es.ServerVar("crules_version")).strip("CheeTaH")))
def es_map_start(ev):
SetUpVars()
def AddRule(category):
tempmenu = popuplib.easymenu('crules_rules__%s'%category,None, SendMenu)
tempmenu.settitle("- CRules \n-- Rules\n--- %s" %(category))
tempmenu.submenu(10, crules_rules_main)
for Line in FileToRead_Rules:
if Line[0] == category:
tempmenu.addoption(0,Line[1],0)
def SendMenu(userid,choice,popupname):
if choice.startswith("crules_admins__"):
Category = choice.split("crules_admins__")[1]
tempcatemenu = popuplib.easymenu("crules_admins__%s"%Category,None,SendMenu)
tempcatemenu.settitle("- CRules\n-- Admins\n--- %s" %(Category))
tempcatemenu.submenu(10,"crules_admins_main")
for Line in FileToRead_Admins:
if Line[0] == Category:
IsOnline = 0
for Player in playerlib.getUseridList('#human'):
if str(es.getplayersteamid(Player)).lower() == str(Line[1]).lower(): IsOnline = Player
if IsOnline: tempcatemenu.addoption(choice,"%s - %s"%(Line[2],es.getplayername(IsOnline)),1)
else: tempcatemenu.addoption(choice,"%s - %s"%(Line[2],"Offline"),0)
popuplib.send(choice,userid)
def SetUpVars():
for var in variables:
vari = es.ServerVar(var[0],var[1],var[2])
vari.set(var[1])
if var[3]: vari.makepublic()
def player_say(ev):
if ev['text'].lower() in Activators:
crules_main.send(ev['userid'])
def player_activate(ev):
if crules_send_on_connect:
gamethread.delayed(crules_timer, crules_main.send, (ev['userid']))
MfG

Random778

Trainee

Posts: 127

Occupation: Schüler

wcf.user.option.userOption53: Nein

  • Send private message

2

Friday, June 28th 2013, 11:45pm

Schau dir mal in Youtube solche Popup's in Python an wie die Leute das machen, dann einfach mal mit machen.
Ist eigentlich einfach in Shell ist einfacher finde ich. :O

MadMakz

Super Moderator

Posts: 1,878

Location: ~#

wcf.user.option.userOption53: Ja

  • Send private message

3

Friday, June 28th 2013, 11:49pm

Code bitte in CODE-Tags posten (Rautesymbol (#) im Editor) damit die Formatierung beibehalten wird.

Bosnien_Fighter

Unregistered

4

Saturday, June 29th 2013, 4:37pm

Habe schon versucht ,mit yt doch ja is nicht so wie ich will ,will eigendlich nur das 1 PLugin umschreiben mehr nicht will einfach noch 2 menü nummern dazu mehr nicht.]


Und hier nochmal im CODE-Tags wie MadMakz verlangt ^^ wusste ich ned sry :

PHP Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# CheeTaH: Rules & Admin

# Add admins/rules in the admins_and_rules.txt file, should be in the same folder as this file.

# CONFIG #
# CONFIG #
# Send crules/admins menu when a player connects?
crules_send_on_connect 1
# If crules_send_on_connect is enabled the menu will be sent on connect.
# Here you can change after how much time, the menu will be sent (seconds)
crules_timer 5
# These aer the commands that will open the menu.
# They must be lower cased!
# Add as many as you want
Activators = ('!admins','!members','!owner','!rules','!regler','!reglen','!info')

# CONFIG DONE - Editing more might cause script to not work!
# CONFIG DONE - Editing more might cause script to not work!

import es
import gamethread
import popuplib
import playerlib

variables = [["crules_version","v1.6CheeTaH","Script version.",1],]

FileToRead_Admins = []
FileToRead_Rules  = []
FileToRead_ open(es.getAddonPath('crules') + '/admins_and_rules.txt').readlines()
for Line in FileToRead_:
    if Line.startswith("|Add Rule|"):
        LineSplit Line.split("|")
        if len(LineSplit) == 5:
            FileToRead_Rules.append(LineSplit[2:4])
    elif Line.startswith("|Add Admin|"):
        LineSplit Line.split("|")
        if len(LineSplit) == 6:
            FileToRead_Admins.append(LineSplit[2:5])
def load():
    SetUpVars()
    es.msg('#multi','#green[CheeTaH Rules \x05%s#green] #defaultLoaded' %(str(es.ServerVar("crules_version")).strip("CheeTaH")))
    global crules_main
    crules_main popuplib.easymenu('crules_main',NoneSendMenu)
    crules_main.settitle("- CRules \n-- Main Menu")
    crules_main.addoption('crules_rules_main''Rules')
    crules_main.addoption('crules_admins_main''Admins')
    global crules_rules_main
    crules_rules_main popuplib.easymenu('crules_rules_main',NoneSendMenu)
    crules_rules_main.settitle("- CRules \n-- Rules")
    crules_rules_main.submenu(10crules_main)
    global crules_admins_main
    crules_admins_main popuplib.easymenu('crules_admins_main',NoneSendMenu)
    crules_admins_main.settitle("- CRules \n-- Admins")
    crules_admins_main.submenu(10crules_main)
    AdminsCategorys = {}
    for Line in FileToRead_Rules:
        if Line[0not in AdminsCategorysAdminsCategorys[Line[0]] = Line[0]
    for cat in sorted(AdminsCategorys.keys()):
        crules_rules_main.addoption("crules_rules__%s" %cat,cat)
        AddRule(cat)
    AdminsCategorys = {}
    for Line in FileToRead_Admins:
        if Line[0not in AdminsCategorysAdminsCategorys[Line[0]] = Line[0]
    for cat in sorted(AdminsCategorys.keys()):
        crules_admins_main.addoption("crules_admins__%s" %cat,cat)
def unload():
    es.msg('#multi','#green[CheeTaH Rules \x05%s#green] #defaultLoaded' %(str(es.ServerVar("crules_version")).strip("CheeTaH")))
def es_map_start(ev):
    SetUpVars()
def AddRule(category):
    tempmenu popuplib.easymenu('crules_rules__%s'%category,NoneSendMenu)
    tempmenu.settitle("- CRules \n-- Rules\n--- %s" %(category))
    tempmenu.submenu(10crules_rules_main)
    for Line in FileToRead_Rules:
        if Line[0] == category:
            tempmenu.addoption(0,Line[1],0)
def SendMenu(userid,choice,popupname):
    if choice.startswith("crules_admins__"):
        Category choice.split("crules_admins__")[1]
        tempcatemenu popuplib.easymenu("crules_admins__%s"%Category,None,SendMenu)
        tempcatemenu.settitle("- CRules\n-- Admins\n--- %s" %(Category))
        tempcatemenu.submenu(10,"crules_admins_main")
        for Line in FileToRead_Admins:
            if Line[0] == Category:
                IsOnline 0
                for Player in playerlib.getUseridList('#human'):
                    if str(es.getplayersteamid(Player)).lower() == str(Line[1]).lower(): IsOnline Player
                if IsOnline:    tempcatemenu.addoption(choice,"%s - %s"%(Line[2],es.getplayername(IsOnline)),1)
                else:           tempcatemenu.addoption(choice,"%s - %s"%(Line[2],"Offline"),0)
    popuplib.send(choice,userid)
def SetUpVars():
    for var in variables:
        vari es.ServerVar(var[0],var[1],var[2])
        vari.set(var[1])
        if var[3]: vari.makepublic()
def player_say(ev):
    if ev['text'].lower() in Activators:
        crules_main.send(ev['userid'])
def player_activate(ev):
    if crules_send_on_connect:
        gamethread.delayed(crules_timercrules_main.send, (ev['userid']))

Similar threads