Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

RSSMySQL playerlist


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
MySQL plugin which keep playerlist table up-to-date. Humans only.
Table store name, steamid, score and time
Attachment 196342
- Then do what ever you like with that table, for example, make PHP page of current players.

Rant:
Read this!
Before you use this plugin, if you have no clue what is MySQL, sql, PHP.

Stop.

Don't use this, this will be too advanced to you.




Installation MySQL table:
- You need manually create table with rows in MySQL, plugin won't do that for you. (I'm lazy to code that part)
- Go phpMyAdmin and select or create database where you want new table.
- After you selected database, go to sql tab page.
- Use these 3 steps queries
Code:

        (XAMPP) MySQL PHPMyAdmin sql query steps:

1)
DROP TABLE IF EXISTS `playerlist`;

2)
CREATE TABLE `playerlist` ( `clientid` INT NOT NULL AUTO_INCREMENT ,
`name` VARCHAR(128) NULL DEFAULT NULL ,
`steamid` VARCHAR(128) NULL DEFAULT NULL ,
`score` INT NOT NULL DEFAULT '0' ,
`time` VARCHAR(15) NULL DEFAULT NULL , PRIMARY KEY (`clientid`));



3)
DELIMITER $$
DROP PROCEDURE IF EXISTS test$$
CREATE PROCEDURE test()
BEGIN
 DECLARE count INT DEFAULT 1;
 WHILE count <= 65 DO
  INSERT INTO `playerlist` () VALUES ();
  SET count = count + 1;
 END WHILE;
END$$
DELIMITER ;


CALL test();

If you have table called playerlist and it have about 65 rows empty data, you are good to go :up:

Installation plugin configure:
- Go ...addons\sourcemod\configs\databases.cfg
- Add playerlist configure with your right database name, example
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"
        }
}

Install plugin:
- mysqlplayerlist.smx into ...addons\sourcemod\plugins folder.

Plugin:
No commands
No cvars
No other settings


Secrects:
In plugin source code *.sp, you can include bots, change table name or change update delay from line
108-110
...and compile your edited plugin.


In-depth how plugin works



Thanks to:
AlliedModders devs, users, forum posts, API and wiki
Other forum users plugin source codes
Stack Overflow posts
Google and translation
YouTube
Valve
Gabe
Microsoft, GitHub
AMD, Intel, Nvidia
Free Programs from internet black hole

No thank you:
spambots
ads

This plugin is just for example to all who are interested, edit and make it to own version.
That is why it have few information stored into database table, it is not Rank plugin.


*edit
Dam, plugin source code not compile in this page.
Need compile yourself
Code:

SourcePawn Compiler 1.11.0.6906
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2021 AlliedModders LLC

Code size:        9112 bytes
Data size:        21884 bytes
Stack/heap size:      17520 bytes
Total requirements:  48516 bytes

BUG:
- Plugin failed to get entity player_manager when server start. Fixed (1.01)

Attached Thumbnails
Click image for larger version

Name:	playerlist.jpg
Views:	N/A
Size:	96.6 KB
ID:	196342  
Attached Files
File Type: smx mysqlplayerlist.smx (6.8 KB)
File Type: sp Get Plugin or Get Source (mysqlplayerlist.sp - 7.4 KB)

Wyświetl pełny artykuł

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...