forked from CrackH34D/Altis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
altislife.sql
executable file
·209 lines (178 loc) · 6.31 KB
/
altislife.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
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Compatible with newer MySQL versions. (After MySQL-5.5)
-- This SQL uses utf8mb4 and has CURRENT_TIMESTAMP function.
--
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `altislife`
-- Default Schema
--
CREATE DATABASE IF NOT EXISTS `altislife` DEFAULT CHARACTER SET utf8mb4;
USE `altislife`;
--
-- Drop procedures to ensure no conflicts
--
DROP PROCEDURE IF EXISTS `resetLifeVehicles`;
DROP PROCEDURE IF EXISTS `deleteDeadVehicles`;
DROP PROCEDURE IF EXISTS `deleteOldHouses`;
DROP PROCEDURE IF EXISTS `deleteOldGangs`;
DROP PROCEDURE IF EXISTS `deleteOldContainers`;
DELIMITER $$
--
-- Procedures
-- Edit arma3 to match a user in MySQL
-- For external databases: Edit localhost to match arma3server IP
--
CREATE DEFINER=`arma3`@`localhost` PROCEDURE `resetLifeVehicles`()
BEGIN
UPDATE `vehicles` SET `active`= 0;
END$$
CREATE DEFINER=`arma3`@`localhost` PROCEDURE `deleteDeadVehicles`()
BEGIN
DELETE FROM `vehicles` WHERE `alive` = 0;
END$$
CREATE DEFINER=`arma3`@`localhost` PROCEDURE `deleteOldHouses`()
BEGIN
DELETE FROM `houses` WHERE `owned` = 0;
END$$
CREATE DEFINER=`arma3`@`localhost` PROCEDURE `deleteOldGangs`()
BEGIN
DELETE FROM `gangs` WHERE `active` = 0;
END$$
CREATE DEFINER=`arma3`@`localhost` PROCEDURE `deleteOldContainers`()
BEGIN
DELETE FROM `containers` WHERE `owned` = 0;
END$$
DELIMITER ;
-- --------------------------------------------------------
--
-- Table structure for table `players`
--
CREATE TABLE IF NOT EXISTS `players` (
`uid` int(12) NOT NULL AUTO_INCREMENT,
`name` varchar(32) NOT NULL,
`aliases` text NOT NULL,
`playerid` varchar(64) NOT NULL,
`cash` int(100) NOT NULL DEFAULT '0',
`bankacc` int(100) NOT NULL DEFAULT '0',
`coplevel` enum('0','1','2','3','4','5','6','7') NOT NULL DEFAULT '0',
`mediclevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
`civ_licenses` text NOT NULL,
`cop_licenses` text NOT NULL,
`med_licenses` text NOT NULL,
`civ_gear` text NOT NULL,
`cop_gear` text NOT NULL,
`med_gear` text NOT NULL,
`civ_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
`cop_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
`med_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
`arrested` tinyint(1) NOT NULL DEFAULT '0',
`adminlevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
`donorlevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
`blacklist` tinyint(1) NOT NULL DEFAULT '0',
`civ_alive` tinyint(1) NOT NULL DEFAULT '0',
`civ_position` varchar(64) NOT NULL DEFAULT '"[]"',
`playtime` varchar(32) NOT NULL DEFAULT '"[0,0,0]"',
`insert_time` timestamp DEFAULT CURRENT_TIMESTAMP,
`last_seen` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`uid`),
UNIQUE KEY `playerid` (`playerid`),
KEY `name` (`name`),
KEY `blacklist` (`blacklist`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=12 ;
-- --------------------------------------------------------
--
-- Table structure for table `vehicles`
--
CREATE TABLE IF NOT EXISTS `vehicles` (
`id` int(12) NOT NULL AUTO_INCREMENT,
`side` varchar(16) NOT NULL,
`classname` varchar(64) NOT NULL,
`type` varchar(16) NOT NULL,
`pid` varchar(32) NOT NULL,
`alive` tinyint(1) NOT NULL DEFAULT '1',
`blacklist` tinyint(1) NOT NULL DEFAULT '0',
`active` tinyint(1) NOT NULL DEFAULT '0',
`plate` int(20) NOT NULL,
`color` int(20) NOT NULL,
`inventory` text NOT NULL,
`gear` text NOT NULL,
`fuel` double NOT NULL DEFAULT '1',
`damage` varchar(256) NOT NULL,
`insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `side` (`side`),
KEY `pid` (`pid`),
KEY `type` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=2 ;
-- --------------------------------------------------------
--
-- Table structure for table `houses`
-- Needed for extDB latest update on git
--
CREATE TABLE IF NOT EXISTS `houses` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`pid` varchar(32) NOT NULL,
`pos` varchar(64) DEFAULT NULL,
`owned` tinyint(1) DEFAULT '0',
`insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`,`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=4 ;
-- --------------------------------------------------------
--
-- Table structure for table `gangs`
-- Needed for extDB latest update on git
--
CREATE TABLE IF NOT EXISTS `gangs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`owner` varchar(32) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL,
`members` text,
`maxmembers` int(3) DEFAULT '8',
`bank` int(100) DEFAULT '0',
`active` tinyint(1) DEFAULT '1',
`insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `name_UNIQUE` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `containers`
-- Needed for extDB latest update on git
--
CREATE TABLE IF NOT EXISTS `containers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`pid` varchar(32) NOT NULL,
`classname` varchar(32) NOT NULL,
`pos` varchar(64) DEFAULT NULL,
`inventory` text NOT NULL,
`gear` text NOT NULL,
`dir` varchar(128) DEFAULT NULL,
`active` tinyint(1) NOT NULL DEFAULT '0',
`owned` tinyint(1) DEFAULT '0',
`insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`,`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=4;
-- --------------------------------------------------------
--
-- Table structure for table `wanted`
-- Needed for extDB latest update on git
--
CREATE TABLE IF NOT EXISTS `wanted` (
`wantedID` varchar(64) NOT NULL,
`wantedName` varchar(32) NOT NULL,
`wantedCrimes` text NOT NULL,
`wantedBounty` int(100) NOT NULL,
`active` tinyint(1) NOT NULL DEFAULT '0',
`insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`wantedID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;