· 6 years ago · Jul 09, 2019, 02:42 PM
1/*
2Source Server : VeniasLife
3*/
4SET FOREIGN_KEY_CHECKS=0;
5
6-- ----------------------------
7-- Table structure for `access`
8-- ----------------------------
9DROP TABLE IF EXISTS `access`;
10CREATE TABLE `access` (
11 `accessID` int(11) NOT NULL AUTO_INCREMENT,
12 `date_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
13 `address` varchar(64) DEFAULT NULL,
14 `failed` int(11) NOT NULL,
15 PRIMARY KEY (`accessID`),
16 UNIQUE KEY `accessID` (`accessID`),
17 KEY `accessID_1` (`accessID`)
18) ENGINE=InnoDB DEFAULT CHARSET=latin1;
19
20-- ----------------------------
21-- Records of access
22-- ----------------------------
23
24-- ----------------------------
25-- Table structure for `containers`
26-- ----------------------------
27DROP TABLE IF EXISTS `containers`;
28CREATE TABLE `containers` (
29 `id` int(6) NOT NULL AUTO_INCREMENT,
30 `pid` varchar(17) NOT NULL,
31 `classname` varchar(32) NOT NULL,
32 `pos` varchar(64) DEFAULT NULL,
33 `inventory` text NOT NULL,
34 `gear` text NOT NULL,
35 `dir` varchar(128) DEFAULT NULL,
36 `active` tinyint(1) NOT NULL DEFAULT '0',
37 `owned` tinyint(1) DEFAULT '0',
38 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
39 PRIMARY KEY (`id`,`pid`) USING BTREE
40) ENGINE=InnoDB AUTO_INCREMENT=109 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT;
41-- ----------------------------
42-- Table structure for `gangs`
43-- ----------------------------
44DROP TABLE IF EXISTS `gangs`;
45CREATE TABLE `gangs` (
46 `id` int(6) NOT NULL AUTO_INCREMENT,
47 `owner` varchar(32) DEFAULT NULL,
48 `name` varchar(32) DEFAULT NULL,
49 `members` text,
50 `maxmembers` int(3) DEFAULT '50',
51 `bank` int(100) DEFAULT '0',
52 `active` tinyint(1) DEFAULT '1',
53 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
54 `tasks` text,
55 PRIMARY KEY (`id`) USING BTREE,
56 UNIQUE KEY `name_UNIQUE` (`name`) USING BTREE
57) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT;
58
59
60-- ----------------------------
61-- Table structure for `houses`
62-- ----------------------------
63DROP TABLE IF EXISTS `houses`;
64CREATE TABLE `houses` (
65 `id` int(6) NOT NULL AUTO_INCREMENT,
66 `pid` varchar(17) NOT NULL,
67 `pos` varchar(64) DEFAULT NULL,
68 `owned` tinyint(1) DEFAULT '0',
69 `garage` tinyint(1) NOT NULL DEFAULT '0',
70 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
71 `property_tax` int(1) NOT NULL DEFAULT '7',
72 PRIMARY KEY (`id`,`pid`) USING BTREE
73) ENGINE=InnoDB AUTO_INCREMENT=1004 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT;
74-- ----------------------------
75-- Table structure for `log`
76-- ----------------------------
77DROP TABLE IF EXISTS `log`;
78CREATE TABLE `log` (
79 `logid` int(11) NOT NULL AUTO_INCREMENT,
80 `date_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
81 `user` varchar(64) DEFAULT NULL,
82 `action` varchar(255) DEFAULT NULL,
83 `level` int(11) NOT NULL,
84 PRIMARY KEY (`logid`),
85 UNIQUE KEY `logid` (`logid`),
86 KEY `logid_2` (`logid`)
87) ENGINE=InnoDB DEFAULT CHARSET=latin1;
88
89-- ----------------------------
90-- Records of log
91-- ----------------------------
92
93-- ----------------------------
94-- Table structure for `messages`
95-- ----------------------------
96DROP TABLE IF EXISTS `messages`;
97CREATE TABLE `messages` (
98 `uid` int(12) NOT NULL AUTO_INCREMENT,
99 `fromID` varchar(50) NOT NULL,
100 `toID` varchar(50) NOT NULL,
101 `message` text,
102 `fromName` varchar(32) NOT NULL,
103 `toName` varchar(32) NOT NULL,
104 `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
105 PRIMARY KEY (`uid`) USING BTREE
106) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
107
108-- ----------------------------
109-- Records of messages
110-- ----------------------------
111
112-- ----------------------------
113-- Table structure for `notes`
114-- ----------------------------
115DROP TABLE IF EXISTS `notes`;
116CREATE TABLE `notes` (
117 `note_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'auto incrementing note_id of each user, unique index',
118 `uid` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
119 `staff_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
120 `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
121 `alias` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
122 `note_text` varchar(255) NOT NULL,
123 `warning` enum('1','2','3','4') NOT NULL,
124 `note_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
125 PRIMARY KEY (`note_id`),
126 UNIQUE KEY `note_id` (`note_id`)
127) ENGINE=InnoDB DEFAULT CHARSET=latin1;
128
129-- ----------------------------
130-- Records of notes
131-- ----------------------------
132
133-- ----------------------------
134-- Table structure for `players`
135-- ----------------------------
136DROP TABLE IF EXISTS `players`;
137CREATE TABLE `players` (
138 `uid` int(6) NOT NULL AUTO_INCREMENT,
139 `name` varchar(32) NOT NULL,
140 `aliases` text NOT NULL,
141 `pid` varchar(17) NOT NULL,
142 `exp_total` int(11) NOT NULL DEFAULT '0',
143 `exp_level` int(11) NOT NULL DEFAULT '0',
144 `cash` int(100) NOT NULL DEFAULT '20',
145 `bankacc` int(100) NOT NULL DEFAULT '0',
146 `wealth_tax` int(11) NOT NULL,
147 `last_wealth` int(100) NOT NULL DEFAULT '0',
148 `taxamount` int(100) NOT NULL DEFAULT '0',
149 `adminlevel` enum('0','1','2') NOT NULL DEFAULT '0',
150 `coplevel` enum('0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16') NOT NULL DEFAULT '0',
151 `copdept` enum('0','1','2','3','4') NOT NULL DEFAULT '0',
152 `mediclevel` enum('0','1','2','3','4','5','6','7','8','9') NOT NULL DEFAULT '0',
153 `medicdept` enum('0','1','2') NOT NULL DEFAULT '0',
154 `donorlevel` enum('0','1') NOT NULL DEFAULT '0',
155 `civ_licenses` text NOT NULL,
156 `cop_licenses` text NOT NULL,
157 `med_licenses` text NOT NULL,
158 `civ_gear` text NOT NULL,
159 `cop_gear` text NOT NULL,
160 `med_gear` text NOT NULL,
161 `civ_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
162 `cop_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
163 `med_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
164 `arrested` tinyint(1) NOT NULL DEFAULT '0',
165 `blacklist` tinyint(1) NOT NULL DEFAULT '0',
166 `civ_alive` tinyint(1) NOT NULL DEFAULT '0',
167 `civ_position` varchar(64) NOT NULL DEFAULT '"[]"',
168 `playtime` varchar(32) NOT NULL DEFAULT '"[0,0,0]"',
169 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
170 `last_seen` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
171 `exp_perkPoints` int(11) NOT NULL DEFAULT '0',
172 `exp_perks` text,
173 `jail_time` int(11) NOT NULL DEFAULT '0',
174 PRIMARY KEY (`uid`) USING BTREE,
175 UNIQUE KEY `pid` (`pid`) USING BTREE,
176 KEY `name` (`name`) USING BTREE,
177 KEY `blacklist` (`blacklist`) USING BTREE
178) ENGINE=InnoDB AUTO_INCREMENT=3000 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT;
179-- ----------------------------
180-- Table structure for `reimbursement_log`
181-- ----------------------------
182DROP TABLE IF EXISTS `reimbursement_log`;
183CREATE TABLE `reimbursement_log` (
184 `reimbursement_id` int(11) NOT NULL AUTO_INCREMENT,
185 `playerid` varchar(50) NOT NULL,
186 `comp` int(100) NOT NULL DEFAULT '0',
187 `reason` varchar(255) NOT NULL,
188 `staff_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
189 `timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
190 PRIMARY KEY (`reimbursement_id`),
191 UNIQUE KEY `reimbursement_id` (`reimbursement_id`)
192) ENGINE=InnoDB DEFAULT CHARSET=latin1;
193
194
195-- ----------------------------
196-- Table structure for `users`
197-- ----------------------------
198DROP TABLE IF EXISTS `users`;
199CREATE TABLE `users` (
200 `ID` mediumint(9) NOT NULL AUTO_INCREMENT,
201 `username` varchar(60) NOT NULL,
202 `password` varchar(80) NOT NULL,
203 `permissions` text NOT NULL,
204 PRIMARY KEY (`ID`)
205) ENGINE=InnoDB DEFAULT CHARSET=utf8;
206
207
208-- ----------------------------
209-- Table structure for `vehicles`
210-- ----------------------------
211DROP TABLE IF EXISTS `vehicles`;
212CREATE TABLE `vehicles` (
213 `id` int(6) NOT NULL AUTO_INCREMENT,
214 `side` varchar(16) NOT NULL,
215 `classname` varchar(64) NOT NULL,
216 `type` varchar(16) NOT NULL,
217 `pid` varchar(17) NOT NULL,
218 `alive` tinyint(1) NOT NULL DEFAULT '1',
219 `blacklist` tinyint(1) NOT NULL DEFAULT '0',
220 `active` tinyint(1) NOT NULL DEFAULT '0',
221 `plate` int(20) NOT NULL,
222 `color` text NOT NULL,
223 `inventory` text NOT NULL,
224 `gear` text NOT NULL,
225 `fuel` double NOT NULL DEFAULT '1',
226 `damage` varchar(256) NOT NULL,
227 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
228 `impound` int(1) NOT NULL DEFAULT '0',
229 `insured` int(1) NOT NULL DEFAULT '0',
230 PRIMARY KEY (`id`) USING BTREE,
231 KEY `side` (`side`) USING BTREE,
232 KEY `pid` (`pid`) USING BTREE,
233 KEY `type` (`type`) USING BTREE
234) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT;
235
236-- ----------------------------
237-- Table structure for `veniaslife_phonemessages`
238-- ----------------------------
239DROP TABLE IF EXISTS `veniaslife_phonemessages`;
240CREATE TABLE `veniaslife_phonemessages` (
241 `sender` varchar(50) DEFAULT NULL,
242 `receiver` varchar(50) DEFAULT NULL,
243 `message` text,
244 `timesent` timestamp NULL DEFAULT CURRENT_TIMESTAMP
245) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
246
247
248-- ----------------------------
249-- Table structure for `veniaslife_phonenumbers`
250-- ----------------------------
251DROP TABLE IF EXISTS `veniaslife_phonenumbers`;
252CREATE TABLE `veniaslife_phonenumbers` (
253 `number` varchar(50) DEFAULT NULL,
254 `uid` varchar(50) DEFAULT NULL
255) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
256
257
258-- ----------------------------
259-- Table structure for `warrants`
260-- ----------------------------
261DROP TABLE IF EXISTS `warrants`;
262CREATE TABLE `warrants` (
263 `id` int(11) NOT NULL AUTO_INCREMENT,
264 `pid` varchar(17) NOT NULL,
265 `crime_id` int(11) NOT NULL,
266 `insert_datetime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
267 PRIMARY KEY (`id`)
268) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=latin1;
269
270
271-- ----------------------------
272-- Table structure for `whitelist`
273-- ----------------------------
274DROP TABLE IF EXISTS `whitelist`;
275CREATE TABLE `whitelist` (
276 `id` int(11) NOT NULL AUTO_INCREMENT,
277 `date_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
278 `user` varchar(64) DEFAULT NULL,
279 `guid` varchar(64) DEFAULT NULL,
280 `uid` varchar(64) DEFAULT NULL,
281 PRIMARY KEY (`id`)
282) ENGINE=InnoDB DEFAULT CHARSET=latin1;
283
284
285-- ----------------------------
286-- Procedure structure for `deleteDeadVehicles`
287-- ----------------------------
288DROP PROCEDURE IF EXISTS `deleteDeadVehicles`;
289DELIMITER ;;
290CREATE DEFINER=`root`@`localhost` PROCEDURE `deleteDeadVehicles`()
291BEGIN
292 DELETE FROM `vehicles` WHERE `alive` = 0;
293END
294;;
295DELIMITER ;
296
297-- ----------------------------
298-- Procedure structure for `deleteOldContainers`
299-- ----------------------------
300DROP PROCEDURE IF EXISTS `deleteOldContainers`;
301DELIMITER ;;
302CREATE DEFINER=`root`@`localhost` PROCEDURE `deleteOldContainers`()
303BEGIN
304 DELETE FROM `containers` WHERE `owned` = 0;
305END
306;;
307DELIMITER ;
308
309-- ----------------------------
310-- Procedure structure for `deleteOldGangs`
311-- ----------------------------
312DROP PROCEDURE IF EXISTS `deleteOldGangs`;
313DELIMITER ;;
314CREATE DEFINER=`root`@`localhost` PROCEDURE `deleteOldGangs`()
315BEGIN
316 DELETE FROM `gangs` WHERE `active` = 0;
317END
318;;
319DELIMITER ;
320
321-- ----------------------------
322-- Procedure structure for `deleteOldHouses`
323-- ----------------------------
324DROP PROCEDURE IF EXISTS `deleteOldHouses`;
325DELIMITER ;;
326CREATE DEFINER=`root`@`localhost` PROCEDURE `deleteOldHouses`()
327BEGIN
328 DELETE FROM `houses` WHERE `owned` = 0;
329END
330;;
331DELIMITER ;
332
333-- ----------------------------
334-- Procedure structure for `deleteUnpaidHouses`
335-- ----------------------------
336DROP PROCEDURE IF EXISTS `deleteUnpaidHouses`;
337DELIMITER ;;
338CREATE DEFINER=`root`@`localhost` PROCEDURE `deleteUnpaidHouses`()
339BEGIN
340 DELETE FROM `houses` WHERE `property_tax` = 0;
341END
342;;
343DELIMITER ;
344
345-- ----------------------------
346-- Procedure structure for `resetLifeVehicles`
347-- ----------------------------
348DROP PROCEDURE IF EXISTS `resetLifeVehicles`;
349DELIMITER ;;
350CREATE DEFINER=`root`@`localhost` PROCEDURE `resetLifeVehicles`()
351BEGIN
352 UPDATE `vehicles` SET `active`= 0;
353END
354;;
355DELIMITER ;
356
357-- ----------------------------
358-- Event structure for `property_tax`
359-- ----------------------------
360DROP EVENT IF EXISTS `property_tax`;
361DELIMITER ;;
362CREATE DEFINER=`root`@`localhost` EVENT `property_tax` ON SCHEDULE EVERY 24 HOUR STARTS '2018-12-14 01:46:15' ON COMPLETION NOT PRESERVE ENABLE DO UPDATE houses SET property_tax = property_tax - 1
363;;
364DELIMITER ;
365
366-- ----------------------------
367-- Event structure for `wealth tax`
368-- ----------------------------
369DROP EVENT IF EXISTS `wealth tax`;
370DELIMITER ;;
371CREATE DEFINER=`root`@`localhost` EVENT `wealth tax` ON SCHEDULE EVERY 24 HOUR STARTS '2018-12-19 00:00:30' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
372UPDATE `players` SET `wealth_tax`=round((bankacc+cash)-round((bankacc+cash)/100 * 98)) WHERE (bankacc+cash) > 1000000;
373
374UPDATE `players` SET `bankacc`=round(((bankacc+cash)/100 * 98) - cash) WHERE (bankacc+cash) > 1000000;
375
376UPDATE `players` SET `taxamount`=taxamount+GREATEST(((bankacc+cash)-last_wealth),0);
377UPDATE `players` SET `last_wealth`=(bankacc+cash);
378END
379;;
380DELIMITER ;