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