Skip to content

💥 Better, flexible, re-written and fast SA:MP/OMP query server client

License

Notifications You must be signed in to change notification settings

larayavrs/sampquery

Repository files navigation

sampquery

Better, flexible, re-written and fast SA:MP/OMP query server client


Introduction

SA:MP Query it is developed to interact with GTA SA:MP/OpenMP servers, allowing to obtain
important data through mechanisms based on a UDP packet system provided by SA:MP.

Note

Learn more about SA:MP Query Mechanisms

New interactive interface

NOTE: Currently unavailable, we are working for a stable version.

menu

Installation

pip install py-sampquery

Usage

import trio
import sampquery as sampq

async def main() -> None:
  server = sampq.SAMPQuery_Client(
    ip='144.217.174.214',
    port=6969
  )
    
  # Getting server information
  server_info = await server.info()
  print(f"Retrieving server data of {server_info.name)
    
  # Players inside
  player_list = await server.players()
  for player in player_list.players:
    print(f"Nickname: {player.name} (Score: {player.score})")

if __name__ == "__main__":
    trio.run(main)

Wanna see some examples? you can check this examples folders.

Contributions

We're open to receiving contributions and improvements for the following enhancements. Feel free to open an issue or create a pull request.