· 10 years ago · Sep 17, 2016, 10:06 AM
1 FormatEx(s_Query, sizeof(s_Query), "CREATE TABLE IF NOT EXISTS `%sboughts` (\
2 `player_id` int(5) NOT NULL,\
3 `item_id` int(5) NOT NULL,\
4 `count` int(4) NOT NULL,\
5 `duration` int(8) NOT NULL,\
6 `timeleft` int(8) NOT NULL,\
7 `buy_price` int(5) NOT NULL,\
8 `sell_price` int(5) NOT NULL,\
9 `buy_time` int(10)\
10 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;", g_sDbPrefix);
11 DB_TQuery(DB_OnPlayersTableLoad, s_Query, 1);
12
13 FormatEx(s_Query, sizeof(s_Query), "CREATE TABLE IF NOT EXISTS `%sitems` (\
14 `id` int(5) NOT NULL AUTO_INCREMENT,\
15 `category` varchar(64) NOT NULL,\
16 `item` varchar(64) NOT NULL,\
17 PRIMARY KEY (`id`)\
18 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;", g_sDbPrefix);
19 DB_TQuery(DB_OnPlayersTableLoad, s_Query, 2);
20
21 FormatEx(s_Query, sizeof(s_Query), "CREATE TABLE IF NOT EXISTS `%splayers` (\
22 `id` int(5) NOT NULL AUTO_INCREMENT,\
23 `name` varchar(32) NOT NULL DEFAULT 'unknown',\
24 `auth` varchar(22) NOT NULL,\
25 `money` int(12) NOT NULL,\
26 `lastconnect` int(10),\
27 PRIMARY KEY (`id`), \
28 UNIQUE KEY `auth` (`auth`) \
29 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;", g_sDbPrefix);
30 DB_TQuery(DB_OnPlayersTableLoad, s_Query, 3);