SA-MP Forums

Go Back   SA-MP Forums > SA-MP Server > Server Support

Reply
 
Thread Tools Display Modes
Old 18/11/2014, 07:27 AM   #1
Clivlend
Little Clucker
 
Join Date: May 2013
Posts: 17
Reputation: 0
Default Samp API Query Mechanism

Hi.
Link: mp.com/wiki/Query_Mechanism#SA-MP_Packets_in_the_real_world
Link 2:http://forum.sa-mp.com/showthread.php?t=104299

How to get players with more than 100 online?

Code class "PHP"
PHP Code:
    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....
Clivlend is offline   Reply With Quote
Old 18/11/2014, 11:49 AM   #2
Clivlend
Little Clucker
 
Join Date: May 2013
Posts: 17
Reputation: 0
Default Re: Samp API Query Mechanism

Please, help me!
Clivlend is offline   Reply With Quote
Old 18/11/2014, 12:06 PM   #3
GWMPT
Gangsta
 
Join Date: Nov 2012
Location: Portugal.
Posts: 988
Reputation: 287
Default Re: Samp API Query Mechanism

SA-MP don't give the output of players(just the number of players connected) when there are more than 100 players connected.
GWMPT is offline   Reply With Quote
Old 18/11/2014, 12:26 PM   #4
Clivlend
Little Clucker
 
Join Date: May 2013
Posts: 17
Reputation: 0
Default Re: Samp API Query Mechanism

There are options for how to get all the players?
Clivlend is offline   Reply With Quote
Old 18/11/2014, 12:39 PM   #5
GWMPT
Gangsta
 
Join Date: Nov 2012
Location: Portugal.
Posts: 988
Reputation: 287
Default Re: Samp API Query Mechanism

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:
Code:
SELECT `Name`,`Score` FROM  `Players` WHERE `Connected` = 1
This should do the trick
GWMPT is offline   Reply With Quote
Old 18/11/2014, 02:23 PM   #6
Clivlend
Little Clucker
 
Join Date: May 2013
Posts: 17
Reputation: 0
Default Re: Samp API Query Mechanism

No, i'm build samp base. Over server. Need get online players.
Clivlend is offline   Reply With Quote
Old 18/11/2014, 05:19 PM   #7
nickdodd25
Huge Clucker
 
nickdodd25's Avatar
 
Join Date: Jan 2012
Location: Unknown
Posts: 449
Reputation: 114
Default Re: Samp API Query Mechanism

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. http://wiki.sa-mp.com/wiki/Query_Mec...e_packet_table
__________________
Nick
nickdodd25 is offline   Reply With Quote
Old 19/11/2014, 09:48 AM   #8
Clivlend
Little Clucker
 
Join Date: May 2013
Posts: 17
Reputation: 0
Default Re: Samp API Query Mechanism

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?
Clivlend is offline   Reply With Quote
Old 19/11/2014, 10:58 AM   #9
Nicow
Big Clucker
 
Nicow's Avatar
 
Join Date: Oct 2012
Location: France
Posts: 95
Reputation: 60
Default Re : Samp API Query Mechanism

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

Nicow is offline   Reply With Quote
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tool/Web/Other] C++ implementation of the RCON/Query mechanism. CodyCummings Tools and Files 8 29/11/2014 03:28 PM
Mechanism question ProjectMan Scripting Help 1 22/08/2013 09:00 AM
C# SAMP Query mechanism (Response packet) [Question]? Niko_boy Everything and Nothing 5 29/06/2013 05:05 PM
SAMP Query Robert_Crawford Server Support 2 06/11/2010 11:54 AM
Query Mechanism [nl]daplayer Help Archive 13 26/02/2010 04:04 AM


All times are GMT. The time now is 06:41 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.