· 9 years ago · Oct 26, 2016, 03:56 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: `altislife`
16-- Default Schema
17--
18CREATE DATABASE IF NOT EXISTS `altislife` DEFAULT CHARACTER SET utf8mb4;
19USE `altislife`;
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=`arma3`@`localhost` PROCEDURE `resetLifeVehicles`() <==
38 je dois peut être le modifier ainsi que les autre ligne
39BEGIN
40 UPDATE `vehicles` SET `active`= 0;
41END$$
42
43CREATE DEFINER=`arma3`@`localhost` PROCEDURE `deleteDeadVehicles`()
44BEGIN
45 DELETE FROM `vehicles` WHERE `alive` = 0;
46END$$
47
48CREATE DEFINER=`arma3`@`localhost` PROCEDURE `deleteOldHouses`()
49BEGIN
50 DELETE FROM `houses` WHERE `owned` = 0;
51END$$
52
53CREATE DEFINER=`arma3`@`localhost` PROCEDURE `deleteOldGangs`()
54BEGIN
55 DELETE FROM `gangs` WHERE `active` = 0;
56END$$
57
58CREATE DEFINER=`arma3`@`localhost` PROCEDURE `deleteOldContainers`()
59BEGIN
60 DELETE FROM `containers` WHERE `owned` = 0;
61END$$
62
63DELIMITER ;
64
65-- --------------------------------------------------------
66
67--
68-- Table structure for table `players`
69--
70
71CREATE TABLE IF NOT EXISTS `players` (
72 `uid` int(12) NOT NULL AUTO_INCREMENT,
73 `name` varchar(32) NOT NULL,
74 `aliases` text NOT NULL,
75 `playerid` varchar(64) NOT NULL,
76 `cash` int(100) NOT NULL DEFAULT '0',
77 `bankacc` int(100) NOT NULL DEFAULT '0',
78 `coplevel` enum('0','1','2','3','4','5','6','7','8','9') NOT NULL DEFAULT '0',
79 `mediclevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
80 `civ_licenses` text NOT NULL,
81 `cop_licenses` text NOT NULL,
82 `med_licenses` text NOT NULL,
83 `civ_gear` text NOT NULL,
84 `cop_gear` text NOT NULL,
85 `med_gear` text NOT NULL,
86 `civ_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
87 `cop_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
88 `med_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
89 `arrested` tinyint(1) NOT NULL DEFAULT '0',
90 `adminlevel` enum('0','1','2','3','4','5','6') NOT NULL DEFAULT '0',
91 `donorlevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
92 `blacklist` tinyint(1) NOT NULL DEFAULT '0',
93 `civ_alive` tinyint(1) NOT NULL DEFAULT '0',
94 `civ_position` varchar(64) NOT NULL DEFAULT '"[]"',
95 `playtime` varchar(32) NOT NULL DEFAULT '"[0,0,0]"',
96 `insert_time` timestamp DEFAULT CURRENT_TIMESTAMP,
97 `last_seen` timestamp NOT NULL,
98 PRIMARY KEY (`uid`),
99 UNIQUE KEY `playerid` (`playerid`),
100 KEY `name` (`name`),
101 KEY `blacklist` (`blacklist`)
102) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=12 ;
103
104-- --------------------------------------------------------
105
106--
107-- Table structure for table `vehicles`
108--
109
110CREATE TABLE IF NOT EXISTS `vehicles` (
111 `id` int(12) NOT NULL AUTO_INCREMENT,
112 `side` varchar(16) NOT NULL,
113 `classname` varchar(64) NOT NULL,
114 `type` varchar(16) NOT NULL,
115 `pid` varchar(32) NOT NULL,
116 `alive` tinyint(1) NOT NULL DEFAULT '1',
117 `blacklist` tinyint(1) NOT NULL DEFAULT '0',
118 `active` tinyint(1) NOT NULL DEFAULT '0',
119 `plate` int(20) NOT NULL,
120 `color` int(20) NOT NULL,
121 `inventory` text NOT NULL,
122 `gear` text NOT NULL,
123 `fuel` double NOT NULL DEFAULT '1',
124 `damage` varchar(256) NOT NULL,
125 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
126 PRIMARY KEY (`id`),
127 KEY `side` (`side`),
128 KEY `pid` (`pid`),
129 KEY `type` (`type`)
130) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=2 ;
131
132-- --------------------------------------------------------
133
134--
135-- Table structure for table `houses`
136-- Needed for extDB latest update on git
137--
138
139CREATE TABLE IF NOT EXISTS `houses` (
140 `id` int(11) NOT NULL AUTO_INCREMENT,
141 `pid` varchar(32) NOT NULL,
142 `pos` varchar(64) DEFAULT NULL,
143 `owned` tinyint(1) DEFAULT '0',
144 `garage` tinyint(1) NOT NULL DEFAULT '0',
145 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
146 PRIMARY KEY (`id`,`pid`)
147) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=4 ;
148
149-- --------------------------------------------------------
150
151--
152-- Table structure for table `gangs`
153-- Needed for extDB latest update on git
154--
155
156CREATE TABLE IF NOT EXISTS `gangs` (
157 `id` int(11) NOT NULL AUTO_INCREMENT,
158 `owner` varchar(32) DEFAULT NULL,
159 `name` varchar(32) DEFAULT NULL,
160 `members` text,
161 `maxmembers` int(3) DEFAULT '8',
162 `bank` int(100) DEFAULT '0',
163 `active` tinyint(1) DEFAULT '1',
164 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
165 PRIMARY KEY (`id`),
166 UNIQUE KEY `name_UNIQUE` (`name`)
167) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
168
169-- --------------------------------------------------------
170
171--
172-- Table structure for table `containers`
173-- Needed for extDB latest update on git
174--
175
176CREATE TABLE IF NOT EXISTS `containers` (
177 `id` int(11) NOT NULL AUTO_INCREMENT,
178 `pid` varchar(32) NOT NULL,
179 `classname` varchar(32) NOT NULL,
180 `pos` varchar(64) DEFAULT NULL,
181 `inventory` text NOT NULL,
182 `gear` text NOT NULL,
183 `dir` varchar(128) DEFAULT NULL,
184 `active` tinyint(1) NOT NULL DEFAULT '0',
185 `owned` tinyint(1) DEFAULT '0',
186 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
187 PRIMARY KEY (`id`,`pid`)
188) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=4;
189
190-- --------------------------------------------------------
191
192--
193-- Table structure for table `wanted`
194-- Needed for extDB latest update on git
195--
196
197CREATE TABLE IF NOT EXISTS `wanted` (
198 `wantedID` varchar(64) NOT NULL,
199 `wantedName` varchar(32) NOT NULL,
200 `wantedCrimes` text NOT NULL,
201 `wantedBounty` int(100) NOT NULL,
202 `active` tinyint(1) NOT NULL DEFAULT '0',
203 `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
204 PRIMARY KEY (`wantedID`)
205) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
206
207-- --------------------------------------------------------
208
209/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
210/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
211/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;