Raised This Month: $12 Target: $400
 3% 

[CS:GO] Simple CSGO Ranks


Post New Thread Reply   
 
Thread Tools Display Modes
Puppetmaster
Senior Member
Join Date: Jun 2015
Location: Probably at a computer.
Old 08-14-2015 , 23:18   Re: [CS:GO] Simple CSGO Ranks
Reply With Quote #11

Quote:
Originally Posted by JawsABK View Post
And if im a windows user?
I am making changes for the next version which should help ;)
__________________

GZS Servers
Puppetmaster is offline
muyap
New Member
Join Date: Sep 2015
Old 09-07-2015 , 09:01   Re: [CS:GO] Simple CSGO Ranks
Reply With Quote #12

its not working for my server :s
muyap is offline
Puppetmaster
Senior Member
Join Date: Jun 2015
Location: Probably at a computer.
Old 09-09-2015 , 00:03   Re: [CS:GO] Simple CSGO Ranks
Reply With Quote #13

Quote:
Originally Posted by muyap View Post
its not working for my server :s
I dont suppose you are able to provide more information? What OS are you using? What port do you have MySQL running on? Have you correctly set up the databases and tables? Is the database.cfg file correctly set up? Does the MySQL user have the correct grants? Are you using the correct MySQL bind address? Does your /var/log/mysql/mysql.log show anything strange? etc...
__________________

GZS Servers
Puppetmaster is offline
MMZ_Kask
Member
Join Date: Jul 2015
Location: Atlanta, GA, USA
Old 09-28-2015 , 18:54   Re: [CS:GO] Simple CSGO Ranks
Reply With Quote #14

Quote:
CREATE DATABASE IF NOT EXISTS steam;
And if we need to use a DB name other than Steam?
MMZ_Kask is offline
DramaLlama
Member
Join Date: Jan 2015
Location: Vancouver
Old 09-30-2015 , 21:49   Re: [CS:GO] Simple CSGO Ranks
Reply With Quote #15

Its cool but can someone edit the position part to say rank instead and the rank part to say score?

http://dramallama.ca/rank.php

^^ my rank page.. just the position should say rank and the rank to say score... can anyone help me out?
__________________

DramaLlama is offline
Puppetmaster
Senior Member
Join Date: Jun 2015
Location: Probably at a computer.
Old 10-02-2015 , 01:25   Re: [CS:GO] Simple CSGO Ranks
Reply With Quote #16

Quote:
Originally Posted by MMZ_Kask View Post
And if we need to use a DB name other than Steam?
Call the DB whatever you like, just make sure you point the default database in databases.cfg to it OR you can add a new DB (not default) and change all of the SQL_DefConnect to SQL_Connect in your custom version.
__________________

GZS Servers
Puppetmaster is offline
Puppetmaster
Senior Member
Join Date: Jun 2015
Location: Probably at a computer.
Old 10-02-2015 , 01:27   Re: [CS:GO] Simple CSGO Ranks
Reply With Quote #17

Quote:
Originally Posted by DramaLlama View Post
Its cool but can someone edit the position part to say rank instead and the rank part to say score?

http://dramallama.ca/rank.php

^^ my rank page.. just the position should say rank and the rank to say score... can anyone help me out?
Sure, I can add this in the next release.
__________________

GZS Servers
Puppetmaster is offline
Puppetmaster
Senior Member
Join Date: Jun 2015
Location: Probably at a computer.
Old 10-03-2015 , 23:24   Re: [CS:GO] Simple CSGO Ranks
Reply With Quote #18

Quote:
Originally Posted by DramaLlama View Post
Its cool but can someone edit the position part to say rank instead and the rank part to say score?

http://dramallama.ca/rank.php

^^ my rank page.. just the position should say rank and the rank to say score... can anyone help me out?
Try this:

Code:
<html><head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<style>
.table, th, td {
border: 0px solid black;
background-color: #428BCA;
border-color: #000 !important;
color: #FFF;
border-radius: 20px;
}
body{
background-color: #000;
}
.table{
width: 400px;
}
</style>
</head>
<body>
<center>
<?php
$topNumber = 20;
$start = round(microtime(true) * 1000);
$servername = "127.0.0.1";
$username = "root";
$password = "";
$dbname = "steam";


// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection

if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

$sql = "SELECT * from steamname JOIN steam st on st.steamId = steamname.steamId WHERE steamname.name not like 'Puppet%' order by cast(st.rank as signed) desc limit " . $topNumber;
$result = $conn->query($sql);

if ($result->num_rows > 0) {
    // output data of each row
$count = 1;
    echo "<table class='table table-bordered'><center><h4><span class='label label-danger'>Top ". $topNumber ."</span></h4></center><br /><thead><tr><th><center><span class='label label-success'>Rank</span></center></th><th><center><span class='label label-success'>Name</span></center></th><th><center><span class='label label-success'>Score</span></center></th></tr></thead>";
    while($row = $result->fetch_assoc()) {
    echo "<tr><td><center>". $count . "</center></td><td><center>". htmlspecialchars($row["name"]) . "</center></td><td><center> " . $row["rank"] . "</center></td></tr>";
    $count+=1; 
    }
} else {
    echo "0 results";
}
echo "</table>";
$conn->close();
usleep(rand(2000,5000));
$end = round(microtime(true) * 1000)-$start;
echo "Took " . $end . " milliseconds to build this page.";
?>
__________________

GZS Servers
Puppetmaster is offline
pommewayne
New Member
Join Date: Oct 2015
Old 10-23-2015 , 04:40   Re: [CS:GO] Simple CSGO Ranks
Reply With Quote #19

Hi,

Sorry to be a pain but this sounds like just the thing i am looking for. The trouble is whilst im not new to server hosting, im new to hosting a cs:go server.

My community would like this feature on our retakes server but i have no idea what or how i would create a MySQL.

Can anyone help me?

I thank you in advance for any help.
pommewayne is offline
Puppetmaster
Senior Member
Join Date: Jun 2015
Location: Probably at a computer.
Old 10-26-2015 , 18:33   Re: [CS:GO] Simple CSGO Ranks
Reply With Quote #20

Quote:
Originally Posted by pommewayne View Post
Hi,

Sorry to be a pain but this sounds like just the thing i am looking for. The trouble is whilst im not new to server hosting, im new to hosting a cs:go server.

My community would like this feature on our retakes server but i have no idea what or how i would create a MySQL.

Can anyone help me?

I thank you in advance for any help.
MySQL is a database system used by many in the industry to store data.
https://en.wikipedia.org/wiki/MySQL

For Ubuntu you might try this:
http://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/
Or
https://www.linode.com/docs/database...n-ubuntu-14-04

For Windows you might try this:
https://dev.mysql.com/doc/refman/5.1...tallation.html

Once you have the database working you might want to have a little read of this:
https://wiki.alliedmods.net/SQL_%28S...d_Scripting%29

You will need to create the database and tables, dont worry though, all the required queries are in the main post.
__________________

GZS Servers
Puppetmaster is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:45.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode