Skip to content

Louzindev/sampquery-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SAMPQUERY C

Simple API for send SA-MP queries with C Language.

Download

Download content from lib/ and bin/ or download a release OR git clone sampquery-c to ur lib folder.

Build

gcc -lsampquery [yoursources] -o [youroutput]

CMake

add_subdirectory(lib/sampquery-c)

Usage

// Getting server info...

#include <stdio.h>
#include <stdlib.h>
#include "sampquery.h"

#define PORT 7777
int main(void)
{
    sampquery_info_pkt_t server_info;
    sampquery_header_t header;
    sampquery_setup_header(&header, "IP Address", PORT);
    sampquery_request(header, INFORMATION_QUERY_PACKET, &server_info);

    printf("Server %s\nGamemode: %s\nLanguage: %s\nMax players: %d\nOnline players: %d\n",
           server_info.hostname, server_info.gamemode, server_info.language, server_info.max_players, server_info.player_count);
    return 0;
}

Building sampquery-c

git clone https://github.com/KriegerDev/sampquery-c.git 
cd sampquery-c
make

About

Simple API for send SA-MP queries with C Language.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published