SA-MP Forums Archive
Getting the online player list, using c++? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: General (https://sampforum.blast.hk/forumdisplay.php?fid=13)
+--- Thread: Getting the online player list, using c++? (/showthread.php?tid=456266)



Getting the online player list, using c++? - paulicaa - 05.08.2013

I saw this
https://sampforum.blast.hk/showthread.php?tid=407156

Is possible to get the online players with c++ / c#?
If so, how ?
I want to make something like online player, using .NET..


Re: Getting the online player list, using c++? - -Prodigy- - 05.08.2013

C++: https://sampforum.blast.hk/showthread.php?tid=129013
C#: https://sampwiki.blast.hk/wiki/Query_Mechanism/Csharp


Re: Getting the online player list, using c++? - paulicaa - 05.08.2013

Quote:
Originally Posted by -Prodigy-
Посмотреть сообщение
using System.IO;
using System;

class Program
{
static void Main()
{
Query.Query sQuery = new Query.Query("89.33.242.97", 7777);

sQuery.Send('c');

int count = sQuery.Recieve();

string[] info = sQuery.Store(count);


for(int i=0; i<count; i++)
Console.WriteLine(info[i] );





}
}



So
c 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.

Why i don't get nothing here?
If I ask for 'i', i get the information of the server..


Re: Getting the online player list, using c++? - paulicaa - 09.08.2013

up .


Re: Getting the online player list, using c++? - Lorenc_ - 09.08.2013

I assume you're using the C# snippet. I'm trying to make my own, a cleaner and simpler one to use...

pawn Код:
byte[] rBuffer = new byte[500];
That was the issue for me, I couldn't get a client list until I increased that to about 2048 or something in the grands.

Anyway, try that, report back and let us see.