-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchangevalue.py
132 lines (101 loc) · 4.99 KB
/
changevalue.py
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#Change value of the damage (weapons)
#SCript by MegaStar 12/05/18
from pyspades.constants import *
from commands import add, admin
SMG_DAMAGE = [75,29,18] #default damage
RIFLE_DAMAGE = [100,49,33] #default damage
SHOTGUN_DAMAGE = [37,27,16] #default damage
@admin
def smgvalue(connection, head_value = "0" ,body_value = "0" ,arms_legs_value = "0"):
if head_value == "0" and body_value == "0" and arms_legs_value == "0":
connection.send_chat("You need to type /smgvalue <value head> <value body> <value arms/legs>")
connection.send_chat("Current SMG damage: HEAD: {} BODY: {} ARMS/LEGS: {}".format(str(SMG_DAMAGE[0]),str(SMG_DAMAGE[1]),str(SMG_DAMAGE[2])))
else:
if head_value == "0":
head_value = SMG_DAMAGE[0]
if body_value == "0":
body_value = SMG_DAMAGE[1]
if arms_legs_value == "0":
arms_legs_value = SMG_DAMAGE[2]
head = int(head_value)
body = int(body_value)
arms_legs = int(arms_legs_value)
SMG_DAMAGE[0] = head
SMG_DAMAGE[1] = body
SMG_DAMAGE[2] = arms_legs
connection.send_chat("You changed the SMG damage by: HEAD: {} BODY: {} ARMS/LEGS: {}".format(str(SMG_DAMAGE[0]),str(SMG_DAMAGE[1]),str(SMG_DAMAGE[2])))
@admin
def riflevalue(connection, head_value = "0" ,body_value = "0",arms_legs_value = "0"):
if head_value == "0" and body_value == "0" and arms_legs_value == "0":
connection.send_chat("You need to type /riflevalue <value head> <value body> <value arms/legs>")
connection.send_chat("Current RIFLE damage: HEAD: {} BODY: {} ARMS/LEGS: {}".format(str(RIFLE_DAMAGE[0]),str(RIFLE_DAMAGE[1]),str(RIFLE_DAMAGE[2])))
else:
if head_value == "0":
head_value = RIFLE_DAMAGE[0]
if body_value == "0":
body_value = RIFLE_DAMAGE[1]
if arms_legs_value == "0":
arms_legs_value = RIFLE_DAMAGE[2]
head = int(head_value)
body = int(body_value)
arms_legs = int(arms_legs_value)
RIFLE_DAMAGE[0] = head
RIFLE_DAMAGE[1] = body
RIFLE_DAMAGE[2] = arms_legs
connection.send_chat("You changed the RIFLE damage by: HEAD: {} BODY: {} ARMS/LEGS: {}".format(str(RIFLE_DAMAGE[0]),str(RIFLE_DAMAGE[1]),str(RIFLE_DAMAGE[2])))
@admin
def shotgunvalue(connection, head_value = "0" ,body_value = "0" ,arms_legs_value = "0"):
if head_value == "0" and body_value == "0" and arms_legs_value == "0":
connection.send_chat("You need to type /shotgunvalue <value head> <value body> <value arms/legs>")
connection.send_chat("Current SHOTGUN damage: HEAD: {} BODY: {} ARMS/LEGS: {}".format(str(SHOTGUN_DAMAGE[0]),str(SHOTGUN_DAMAGE[1]),str(SHOTGUN_DAMAGE[2])))
else:
if head_value == "0":
head_value = SHOTGUN_DAMAGE[0]
if body_value == "0":
body_value = SHOTGUN_DAMAGE[1]
if arms_legs_value == "0":
arms_legs_value = SHOTGUN_DAMAGE[2]
head = int(head_value)
body = int(body_value)
arms_legs = int(arms_legs_value)
SHOTGUN_DAMAGE[0] = head
SHOTGUN_DAMAGE[1] = body
SHOTGUN_DAMAGE[2] = arms_legs
connection.send_chat("You changed the SHOTGUN damage by: HEAD: {} BODY: {} ARMS/LEGS: {}".format(str(SHOTGUN_DAMAGE[0]),str(SHOTGUN_DAMAGE[1]),str(SHOTGUN_DAMAGE[2])))
@admin
def debug(connection):
global SMG_DAMAGE
global RIFLE_DAMAGE
global SHOTGUN_DAMAGE
SMG_DAMAGE = [75,29,18] #default damage
RIFLE_DAMAGE = [100,49,33] #default damage
SHOTGUN_DAMAGE = [37,27,16] #default damage
connection.send_chat("The damage of all the weapons have just been put in default")
add(smgvalue)
add(riflevalue)
add(shotgunvalue)
add(debug)
def apply_script(protocol,connection,config):
class TestConnection(connection):
def on_hit(self, hit_amount, hit_player, type, grenade):
if type in (WEAPON_KILL,HEADSHOT_KILL):
if hit_amount == 100:
return RIFLE_DAMAGE[0]
elif hit_amount == 49:
return RIFLE_DAMAGE[1]
elif hit_amount == 33:
return RIFLE_DAMAGE[2]
elif hit_amount == 75:
return SMG_DAMAGE[0]
elif hit_amount == 29:
return SMG_DAMAGE[1]
elif hit_amount == 18:
return SMG_DAMAGE[2]
elif hit_amount == 37:
return SHOTGUN_DAMAGE[0]
elif hit_amount == 27:
return SHOTGUN_DAMAGE[1]
elif hit_amount == 16:
return SHOTGUN_DAMAGE[2]
return connection.on_hit(self, hit_amount, hit_player, type, grenade)
return protocol, TestConnection