Raised This Month: $54 Target: $400
 13% 

[REQ] [CSGO] Player List


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sajmooooon
Senior Member
Join Date: Nov 2018
Location: Slovakia
Old 07-31-2022 , 09:11   [REQ] [CSGO] Player List
Reply With Quote #1

Hi, I'm looking for plugin that will save current player list (player name, steamid, score, time on server) to mysql and update list on player leave/join to server.

Thanks for help.
Sajmooooon is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-15-2022 , 23:05   Re: [REQ] [CSGO] Player List
Reply With Quote #2

*edit 17.8.2022 Plugin topic MySQL playerlist

There maybe is plugin what do that task.
But I did not search it.


I made example/test plugin. I have not test it with lot of players.


First, in MySQL, need create table with rows manually. Plugin will not do those.

- Select or create database where you want new table
- After you selected database, go to SQL query tab page (I use PHPMyAdmin). We execute SQL queries.
- You see 3 steps of query codes in plugin source code, at top in /* comment */ section. Try use those in PHPMyAdmin sql tab page

-- 1) drop table if it exist
-- 2) create table with default values
-- 3) use for loop to add 65 rows with default values


Now you should have table called "playerlist" with 65 rows empty data (expect increment clientid value)


Add plugin configure ("playerlist") in SM database.cfg
Code:
"Databases"
{
    "driver_default"        "mysql"
    
    // When specifying "host", you may use an IP address, a hostname, or a socket file path
    
    "default"
    {
        "driver"            "default"
        "host"                "localhost"
        "database"            "sourcemod"
        "user"                "root"
        "pass"                ""
        //"timeout"            "0"
        //"port"            "0"
    }
    
    "playerlist"
    {
        "driver"            "default"
        "host"                "localhost"
        "database"            "database_test"
        "user"                "root"
        "pass"                ""
        //"timeout"            "0"
        //"port"            "0"
    }
    
    "storage-local"
    {
        "driver"            "sqlite"
        "database"            "sourcemod-local"
    }

    "clientprefs"
    {
        "driver"            "sqlite"
        "host"                "localhost"
        "database"            "clientprefs-sqlite"
        "user"                "root"
        "pass"                ""
        //"timeout"            "0"
        //"port"            "0"
    }
}
plugin new version

- NEW! This version send less amount of queries. It update necessary slots only.


plugin old version



Click image for larger version

Name:	playerlist.png
Views:	13
Size:	95.5 KB
ID:	196324


- Plugin list only human players. It updates data of each 65 rows.
- Plugin update table every 10 seconds, and stop updating when there is no human players in server.

- You can query active players, example using NULL value:
Code:
SELECT * FROM `playerlist` WHERE steamid IS NOT NULL;
- name, steamid, time are strings
clientid, score is int

- If table is some reason over 65 rows, you can do those 3 steps again to fix it.
__________________
Do not Private Message @me

Last edited by Bacardi; 08-17-2022 at 14:25. Reason: plugin link
Bacardi 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 12:38.


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