Samp API Query Mechanism
#1

Hi.
Link: mp.com/wiki/Query_Mechanism#SA-MP_Packets_in_the_real_world
Link 2:https://sampforum.blast.hk/showthread.php?tid=104299

How to get players with more than 100 online?

Code class "PHP"
PHP код:
    public function getBasicPlayers() {
        @
fwrite($this->sock$this->assemblePacket("c"));
        
fread($this->sock11);
        
$playerCount ord(fread($this->sock2));
        
$players = array();
        if(
$playerCount 0) {
            for(
$i 0$i $playerCount; ++$i) {
                
$strLen ord(fread($this->sock1));
                
$players[$i] = array
                (
                    
"name" => (string) fread($this->sock$strLen),
                    
"score" => (integer) $this->toInt(fread($this->sock4)),
                );
            }
        }
        return 
$players;
    } 
Receives only 100 players....
Reply
#2

Please, help me!
Reply
#3

SA-MP don't give the output of players(just the number of players connected) when there are more than 100 players connected.
Reply
#4

There are options for how to get all the players?
Reply
#5

If you're going to use it for your own server, there are ways.
For example:
You had a new column in the Player table, with the name "connected"(smallint)
When a player connect, and load his data, you put the value there for 1.
When the player disconnects, change the value for 0

Now, you just need to query the database, example:
Код:
SELECT `Name`,`Score` FROM  `Players` WHERE `Connected` = 1
This should do the trick
Reply
#6

No, i'm build samp base. Over server. Need get online players.
Reply
#7

Then make some type of script that stores online players like Kikito suggested.

As you can read just below from where your link takes you it says that the the packets for player lists are throttled to 100 users. https://sampwiki.blast.hk/wiki/Query_Mec...e_packet_table
Reply
#8

But...
It stands for client list, this sends back to the server the players' name, and then the players' score. Just imagine it as a basic overview of all the players. Throttled to 100, but can theoretically support 65536 different IDs.

Probably still available online over 100?
Reply
#9

It should be but it's throttled to 100, we can't bypass the limitation
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)