Getting the online player list, using c++?
#1

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..
Reply
#2

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

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..
Reply
#4

up .
Reply
#5

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)