· 9 years ago · Dec 01, 2016, 09:36 PM
1SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
2SET time_zone = "+00:00";
3--
4-- Compatible with newer MySQL versions. (After MySQL-5.5)
5-- This SQL uses utf8mb4 and has CURRENT_TIMESTAMP function.
6--
7
8
9/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
10/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
11/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
12/*!40101 SET NAMES utf8mb4 */;
13
14--
15-- Database: `aaawzvkd_pantheralife`
16-- Default Schema
17--
18CREATE DATABASE IF NOT EXISTS `aaawzvkd_pantheralife` DEFAULT CHARACTER SET utf8mb4;
19USE `aaawzvkd_pantheralife`;
20
21--
22-- Drop procedures to ensure no conflicts
23--
24DROP PROCEDURE IF EXISTS `resetLifeVehicles`;
25DROP PROCEDURE IF EXISTS `deleteDeadVehicles`;
26DROP PROCEDURE IF EXISTS `deleteOldHouses`;
27DROP PROCEDURE IF EXISTS `deleteOldGangs`;
28DROP PROCEDURE IF EXISTS `deleteOldContainers`;
29
30DELIMITER $$
31--
32-- Procedures
33-- Edit arma3 to match a user in MySQL
34-- For external databases: Edit localhost to match arma3server IP
35--
36
37CREATE DEFINER=`aaawzvkd`@`216.52.143.47` PROCEDURE `resetLifeVehicles`()
38BEGIN
39 UPDATE `vehicles` SET `active`= 0;
40END$$
41
42CREATE DEFINER=`aaawzvkd`@`216.52.143.47` PROCEDURE `deleteDeadVehicles`()
43BEGIN
44 DELETE FROM `vehicles` WHERE `alive` = 0;
45END$$
46
47CREATE DEFINER=`aaawzvkd`@`216.52.143.47` PROCEDURE `deleteOldHouses`()
48BEGIN
49 DELETE FROM `houses` WHERE `owned` = 0;
50END$$
51
52CREATE DEFINER=`aaawzvkd`@`216.52.143.47` PROCEDURE `deleteOldGangs`()
53BEGIN
54 DELETE FROM `gangs` WHERE `active` = 0;
55END$$
56
57CREATE DEFINER=`aaawzvkd`@`216.52.143.47` PROCEDURE `deleteOldContainers`()
58BEGIN
59 DELETE FROM `containers` WHERE `owned` = 0;
60END$$
61
62DELIMITER ;
63
64-- --------------------------------------------------------
65
66--
67-- Table structure for table `players`
68--
69
70CREATE TABLE IF NOT EXISTS `players` (
71 `uid` int(6) NOT NULL AUTO_INCREMENT,
72 `name` varchar(32) NOT NULL,
73 `aliases` text NOT NULL,
74 `pid` varchar(17) NOT NULL,
75 `cash` int(100) NOT NULL DEFAULT '0',
76 `bankacc` int(100) NOT NULL DEFAULT '0',
77 `coplevel` enum('0','1','2','3','4','5','6','7') NOT NULL DEFAULT '0',
78 `mediclevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
79 `civ_licenses` text NOT NULL,
80 `cop_licenses` text NOT NULL,
81 `med_licenses` text NOT NULL,
82 `civ_gear` text NOT NULL,
83 `cop_gear` text NOT NULL,
84 `med_gear` text NOT NULL,
85 `civ_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
86 `cop_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
87 `med_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
88 `arrested` tinyint(1) NOT NULL DEFAULT '0',
89 `adminlevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
90 `donorlevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
91 `blacklist` tinyint(1) NOT NULL DEFAULT '0',
92 `civ_alive` tinyint(1) NOT NULL DEFAULT '0',
93 `civ_position` varchar(64) NOT NULL DEFAULT '"[]"',
94 `playtime` varchar(32) NOT NULL DEFAULT '"[0,0,0]"',
95 `insert_time` timestamp DEFAULT CURRENT_TIMESTAMP,
96 `last_seen` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
97 PRIMARY KEY (`uid`),
98 UNIQUE KEY `pid` (`pid`),
99 KEY `name` (`name`),
100 KEY `blacklist` (`blacklist`)
101) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=12 ;
102
103-- --------------------------------------------------------
104
105--
106-- Table structure for table `vehicles`
107--
108
109CREATE TABLE IF NOT EXISTS `vehicles` (
110 `id` int(6) NOT NULL AUTO_INCREMENT,
111 `side` varchar(16) NOT NULL,
112 `classname` varchar(64) NOT NULL,
113 `type` varchar(16) NOT NULL,
114 `pid` varchar(17) NOT NULL,
115 `alive` tinyint(1) NOT NULL DEFAULT '1',
116 `blacklist` tinyint(1) NOT NULL DEFAULT '0',
117 `active` tinyint(1) NOT NULL DEFAULT '0',
118 `plate` int(20) NOT NULL,
119 `color` int(20) NOT NULL,
120 `inventory` text NOT NULL,
121 `gear` text NOT NULL,
122 `fuel` double NOT NULL DEFAULT '1',
123 `damage` varchar(256) NOT NULL,
124 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
125 PRIMARY KEY (`id`),
126 KEY `side` (`side`),
127 KEY `pid` (`pid`),
128 KEY `type` (`type`)
129) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=2 ;
130
131-- --------------------------------------------------------
132
133--
134-- Table structure for table `houses`
135-- Needed for extDB latest update on git
136--
137
138CREATE TABLE IF NOT EXISTS `houses` (
139 `id` int(6) NOT NULL AUTO_INCREMENT,
140 `pid` varchar(17) NOT NULL,
141 `pos` varchar(64) DEFAULT NULL,
142 `owned` tinyint(1) DEFAULT '0',
143 `garage` tinyint(1) NOT NULL DEFAULT '0',
144 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
145 PRIMARY KEY (`id`,`pid`)
146) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=4 ;
147
148-- --------------------------------------------------------
149
150--
151-- Table structure for table `gangs`
152-- Needed for extDB latest update on git
153--
154
155CREATE TABLE IF NOT EXISTS `gangs` (
156 `id` int(6) NOT NULL AUTO_INCREMENT,
157 `owner` varchar(32) DEFAULT NULL,
158 `name` varchar(32) DEFAULT NULL,
159 `members` text,
160 `maxmembers` int(3) DEFAULT '8',
161 `bank` int(100) DEFAULT '0',
162 `active` tinyint(1) DEFAULT '1',
163 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
164 PRIMARY KEY (`id`),
165 UNIQUE KEY `name_UNIQUE` (`name`)
166) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
167
168-- --------------------------------------------------------
169
170--
171-- Table structure for table `containers`
172-- Needed for extDB latest update on git
173--
174
175CREATE TABLE IF NOT EXISTS `containers` (
176 `id` int(6) NOT NULL AUTO_INCREMENT,
177 `pid` varchar(17) NOT NULL,
178 `classname` varchar(32) NOT NULL,
179 `pos` varchar(64) DEFAULT NULL,
180 `inventory` text NOT NULL,
181 `gear` text NOT NULL,
182 `dir` varchar(128) DEFAULT NULL,
183 `active` tinyint(1) NOT NULL DEFAULT '0',
184 `owned` tinyint(1) DEFAULT '0',
185 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
186 PRIMARY KEY (`id`,`pid`)
187) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=4;
188
189-- --------------------------------------------------------
190
191--
192-- Table structure for table `wanted`
193-- Needed for extDB latest update on git
194--
195
196CREATE TABLE IF NOT EXISTS `wanted` (
197 `wantedID` varchar(64) NOT NULL,
198 `wantedName` varchar(32) NOT NULL,
199 `wantedCrimes` text NOT NULL,
200 `wantedBounty` int(100) NOT NULL,
201 `active` tinyint(1) NOT NULL DEFAULT '0',
202 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
203 PRIMARY KEY (`wantedID`)
204) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
205
206-- --------------------------------------------------------
207
208/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
209/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
210/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;