forked from Rukenshia/Distrikt41
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDistrikt41-1.1_DB.sql
250 lines (230 loc) · 8.35 KB
/
Distrikt41-1.1_DB.sql
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `gangs`
-- ----------------------------
DROP TABLE IF EXISTS `gangs`;
CREATE TABLE `gangs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`owner` varchar(32) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL,
`members` text,
`maxmembers` int(2) DEFAULT '2',
`bank` int(100) DEFAULT '0',
`active` tinyint(4) DEFAULT '1',
PRIMARY KEY (`id`),
UNIQUE KEY `name_UNIQUE` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of gangs
-- ----------------------------
-- ----------------------------
-- Table structure for `houses`
-- ----------------------------
DROP TABLE IF EXISTS `houses`;
CREATE TABLE `houses` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`pid` varchar(32) NOT NULL,
`gid` varchar(12) NOT NULL DEFAULT '0',
`pos` varchar(64) DEFAULT NULL,
`containers` text,
`owned` tinyint(4) DEFAULT '0',
`rentdate` int(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`,`pid`,`gid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of houses
-- ----------------------------
-- ----------------------------
-- Table structure for `players`
-- ----------------------------
DROP TABLE IF EXISTS `players`;
CREATE TABLE `players` (
`uid` int(12) NOT NULL AUTO_INCREMENT,
`playerid` varchar(50) NOT NULL,
`name` varchar(32) NOT NULL,
`aliases` text NOT NULL,
`cash` int(100) NOT NULL DEFAULT '0',
`bankacc` int(100) NOT NULL DEFAULT '0',
`Karma` int(100) NOT NULL DEFAULT '1',
`civ_gear` text NOT NULL,
`civ_licenses` text,
`arrested` tinyint(1) NOT NULL DEFAULT '0',
`jail_time` int(11) NOT NULL DEFAULT '0',
`coplevel` enum('0','1','2','3','4','5','6','7','8','9','10','11') NOT NULL DEFAULT '0',
`cop_gear` text NOT NULL,
`cop_licenses` text,
`mediclevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
`med_gear` text NOT NULL,
`med_licenses` text,
`adminlevel` enum('0','1','2','3') NOT NULL DEFAULT '0',
`blacklist` tinyint(1) NOT NULL DEFAULT '0',
`LastLogin` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`died` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`uid`,`playerid`,`LastLogin`),
UNIQUE KEY `playerid` (`playerid`),
KEY `name` (`name`),
KEY `blacklist` (`blacklist`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of players
-- ----------------------------
-- ----------------------------
-- Table structure for `skillsys`
-- ----------------------------
DROP TABLE IF EXISTS `skillsys`;
CREATE TABLE `skillsys` (
`playerid` varchar(50) NOT NULL DEFAULT '0',
`D41_Apfel` int(100) NOT NULL DEFAULT '0',
`D41_Pfirsich` int(100) NOT NULL DEFAULT '0',
`D41_Kalkstein` int(100) NOT NULL DEFAULT '0',
`D41_Salz` int(100) NOT NULL DEFAULT '0',
`D41_Sand` int(100) NOT NULL DEFAULT '0',
`D41_EisenRoh` int(100) NOT NULL DEFAULT '0',
`D41_KupferRoh` int(100) NOT NULL DEFAULT '0',
`D41_DiamantenRoh` int(100) NOT NULL DEFAULT '0',
`D41_CannabisRoh` int(100) NOT NULL DEFAULT '0',
`D41_KokainRoh` int(100) NOT NULL DEFAULT '0',
`D41_HeroinRoh` int(100) NOT NULL DEFAULT '0',
`D41_OelRoh` int(100) NOT NULL DEFAULT '0',
`D41_FleischRoh` int(100) NOT NULL DEFAULT '0',
`D41_KohleRoh` int(100) NOT NULL DEFAULT '0',
`D41_Bruchstein` int(100) NOT NULL DEFAULT '0',
`D41_TonRoh` int(100) NOT NULL DEFAULT '0',
`D41_Krabben` int(100) NOT NULL DEFAULT '0',
`D41_Fischen` int(100) NOT NULL DEFAULT '0',
PRIMARY KEY (`playerid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- ----------------------------
-- Records of skillsys
-- ----------------------------
-- ----------------------------
-- Table structure for `stocksys`
-- ----------------------------
DROP TABLE IF EXISTS `stocksys`;
CREATE TABLE `stocksys` (
`ID` decimal(32,0) NOT NULL DEFAULT '1',
`D41_Apfel` int(32) NOT NULL DEFAULT '0',
`D41_Pfirsich` int(32) NOT NULL DEFAULT '0',
`D41_Apfelschnaps` int(32) NOT NULL DEFAULT '0',
`D41_Pfirsichschnaps` int(32) NOT NULL DEFAULT '0',
`D41_Heroin` int(32) NOT NULL DEFAULT '0',
`D41_Oel` int(32) NOT NULL DEFAULT '0',
`D41_Cannabis` int(32) NOT NULL DEFAULT '0',
`D41_BeefJerky` int(32) NOT NULL DEFAULT '0',
`D41_Kokain` int(32) NOT NULL DEFAULT '0',
`D41_Diamanten` int(32) NOT NULL DEFAULT '0',
`D41_Eisen` int(32) NOT NULL DEFAULT '0',
`D41_Kupfer` int(32) NOT NULL DEFAULT '0',
`D41_Salz` int(32) NOT NULL DEFAULT '0',
`D41_Kohle` int(32) NOT NULL DEFAULT '0',
`D41_Glas` int(32) NOT NULL DEFAULT '0',
`D41_Apfelsaft` int(32) NOT NULL DEFAULT '0',
`D41_Pfirsichsaft` int(32) NOT NULL DEFAULT '0',
`D41_Ton` int(32) NOT NULL DEFAULT '0',
`D41_Zement` int(32) NOT NULL DEFAULT '0',
`D41_WaffenKomponenten` int(32) NOT NULL DEFAULT '0',
`D41_Stahl` int(32) NOT NULL DEFAULT '0',
`D41_Fahrzeugteile` int(32) NOT NULL DEFAULT '0',
`D41_Kerosin` int(32) NOT NULL DEFAULT '0',
`D41_Kalkstein` int(32) NOT NULL DEFAULT '0',
`D41_Krabben` int(32) NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- ----------------------------
-- Records of stocksys
-- ----------------------------
INSERT INTO `stocksys` VALUES ('1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0');
-- ----------------------------
-- Table structure for `vehicles`
-- ----------------------------
DROP TABLE IF EXISTS `vehicles`;
CREATE TABLE `vehicles` (
`id` int(12) NOT NULL AUTO_INCREMENT,
`side` varchar(15) NOT NULL,
`classname` varchar(32) NOT NULL,
`type` varchar(12) NOT NULL,
`pid` varchar(32) NOT NULL,
`alive` tinyint(1) NOT NULL DEFAULT '1',
`active` tinyint(1) NOT NULL DEFAULT '0',
`plate` int(20) NOT NULL,
`color` int(20) NOT NULL,
PRIMARY KEY (`id`),
KEY `side` (`side`),
KEY `pid` (`pid`),
KEY `type` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of vehicles
-- ----------------------------
-- ----------------------------
-- Table structure for `wanted`
-- ----------------------------
DROP TABLE IF EXISTS `wanted`;
CREATE TABLE `wanted` (
`wantedID` varchar(50) NOT NULL,
`wantedName` varchar(52) NOT NULL,
`wantedCrimes` text NOT NULL,
`wantedBounty` int(100) NOT NULL,
`active` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`wantedID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of wanted
-- ----------------------------
-- ----------------------------
-- Procedure structure for `deleteDeadVehicles`
-- ----------------------------
DROP PROCEDURE IF EXISTS `deleteDeadVehicles`;
DELIMITER ;;
CREATE DEFINER=`D41_MySQL`@`localhost` PROCEDURE `deleteDeadVehicles`()
BEGIN
DELETE FROM `vehicles` WHERE `alive` = 0;
END
;;
DELIMITER ;
-- ----------------------------
-- Procedure structure for `deleteOldGangs`
-- ----------------------------
DROP PROCEDURE IF EXISTS `deleteOldGangs`;
DELIMITER ;;
CREATE DEFINER=`D41_MySQL`@`localhost` PROCEDURE `deleteOldGangs`()
DELETE FROM gangs WHERE `active`= 0
;;
DELIMITER ;
-- ----------------------------
-- Procedure structure for `DeleteOldHouses`
-- ----------------------------
DROP PROCEDURE IF EXISTS `DeleteOldHouses`;
DELIMITER ;;
CREATE DEFINER=`D41_MySQL`@`localhost` PROCEDURE `DeleteOldHouses`()
DELETE FROM houses WHERE rentdate < 1
;;
DELIMITER ;
-- ----------------------------
-- Procedure structure for `resetLifeVehicles`
-- ----------------------------
DROP PROCEDURE IF EXISTS `resetLifeVehicles`;
DELIMITER ;;
CREATE DEFINER=`D41_MySQL`@`localhost` PROCEDURE `resetLifeVehicles`()
BEGIN
UPDATE vehicles SET `active`= 0;
END
;;
DELIMITER ;
-- ----------------------------
-- Event structure for `4hHouseRentTimer`
-- ----------------------------
DROP EVENT IF EXISTS `4hHouseRentTimer`;
DELIMITER ;;
CREATE DEFINER=`D41_MySQL`@`localhost` EVENT `4hHouseRentTimer` ON SCHEDULE EVERY 4 HOUR STARTS '2014-09-13 03:59:55' ON COMPLETION NOT PRESERVE ENABLE DO UPDATE houses
SET rentdate = rentdate - 1
;;
DELIMITER ;
-- ----------------------------
-- Event structure for `6WeeksPlayerDelete`
-- ----------------------------
DROP EVENT IF EXISTS `6WeeksPlayerDelete`;
DELIMITER ;;
CREATE DEFINER=`D41_MySQL`@`localhost` EVENT `6WeeksPlayerDelete` ON SCHEDULE EVERY 1 DAY STARTS '2014-09-13 23:59:55' ON COMPLETION NOT PRESERVE ENABLE DO DELETE FROM players where lastLogin < DATE_SUB( CURRENT_TIME(), INTERVAL 6 Week)
;;
DELIMITER ;