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
|
import es
import usermsg
import gamethread
### CONFIG ###
min_rate = 25000 # wenn rate unter 25000 dann wird set_rate geforced
min_cmdrate = 100 # das selbe
min_updaterate = 100 # das selbe
set_rate = 25000 # setze rate auf 25000 wenn rate unter min_rate
set_cmdrate = 100 # das selbe
set_updaterate = 100 # das selbe
#### ENDE ####
class FixRates(int):
def __init__(self, uid):
self.uid = int(uid)
self.CheckIt()
def GetRate(self, rate):
es.set("temp_rate", 0)
es.server.cmd("es_xgetclientvar temp_rate %i %s" % (self.uid, rate))
return es.getInt("temp_rate")
def SetRate(self):
es.usermsg("create", "setze_vars", "VGUIMenu")
es.usermsg("write", "string", "setze_vars", "info")
es.usermsg("write", "byte", "setze_vars", 1)
es.usermsg("write", "byte", "setze_vars", 4)
es.usermsg("write", "string", "setze_vars", "type")
es.usermsg("write", "string", "setze_vars", 0)
es.usermsg("write", "string", "setze_vars", "title")
es.usermsg("write", "string", "setze_vars", "FixRates by sea212. check out http://mattie.info")
es.usermsg("write", "string", "setze_vars", "msg")
es.usermsg("write", "string", "setze_vars", "You have the wrong rates. The server has fixed your rates... Please close this window.")
es.usermsg("write", "string", "setze_vars", "cmd")
es.usermsg("write", "string", "setze_vars", "rate %i; cl_cmdrate %i; cl_updaterate %i" % (set_rate, set_cmdrate, set_updaterate))
es.usermsg("send", "setze_vars", self.uid)
es.usermsg("delete", "setze_vars")
def CheckIt(self):
rate = self.GetRate("rate")
crate = self.GetRate("cl_cmdrate")
urate = self.GetRate("cl_updaterate")
if min_rate > rate or min_cmdrate > crate or min_updaterate > urate:
self.SetRate()
es.tell(self.uid, "#multi", "#lightgreen[FixRates]#green fixed your rates...")
else:
es.tell(self.uid, "#multi", "#lightgreen[FixRates]#green your rates are ok.")
def player_activate(ev):
FixRates(ev["userid"])
def player_spawn(ev):
FixRates(ev["userid"])
|