Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- (
- IFNULL(LOG(1.5, cashearned),0) +
- IFNULL(LOG(1.3, roundswon), 0) +
- (
- SELECT COUNT(*)
- FROM achievements_new
- WHERE `value` = -1 AND achievements_new.id = playerdata.id
- )
- ) as rank,
- nationality,
- nick,
- steamid64,
- cash,
- playtime,
- damage,
- destroyed,
- (
- SELECT SUM(price)
- FROM weaponprices
- WHERE weapon IN
- (
- SELECT class
- FROM playerweapons
- WHERE playerweapons.id = playerdata.id
- )
- ) as wepvalue,
- (
- SELECT COUNT(*)
- FROM achievements_new
- WHERE `value` = -1 AND achievements_new.id = playerdata.id
- ) as achcount,
- lastplayed
- FROM playerdata
- ORDER BY rank DESC
- CREATE TABLE IF NOT EXISTS `playerdata` (
- `id` int(11) unsigned NOT NULL,
- `steamid64` char(17) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
- `nick` varchar(32) NOT NULL DEFAULT '',
- `cash` int(32) unsigned NOT NULL DEFAULT '0',
- `playtime` int(32) unsigned NOT NULL DEFAULT '0',
- `nationality` char(2) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
- `damage` int(32) unsigned NOT NULL DEFAULT '0',
- `destroyed` int(32) unsigned NOT NULL DEFAULT '0',
- `cashearned` int(10) unsigned NOT NULL,
- `roundswon` smallint(5) unsigned NOT NULL,
- `lastplayed` datetime NOT NULL,
- ) ENGINE=InnoDB
- CREATE TABLE IF NOT EXISTS `achievements_new` (
- `id` int(10) unsigned NOT NULL,
- `achkey` enum(<snip - lots of values here>) NOT NULL,
- `value` mediumint(8) NOT NULL DEFAULT '0'
- ) ENGINE=InnoDB
- CREATE TABLE IF NOT EXISTS `playerweapons` (
- `id` int(10) unsigned NOT NULL,
- `class` varchar(30) CHARACTER SET ascii NOT NULL
- ) ENGINE=InnoDB
- CREATE TABLE IF NOT EXISTS `weaponprices` (
- `weapon` varchar(30) NOT NULL,
- `price` int(10) unsigned NOT NULL
- ) ENGINE=InnoDB
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement