Library based on the samp query api script, provides better efficiency and better optimization for the use of the sa-mp api

1.2 2024-02-11 22:21 UTC

This package is auto-updated.

Last update: 2024-09-12 00:26:19 UTC


README

Library to work with the native sa-mp Query. This is based on David Weston's script, despite being based on his general script, this library has many improvements and optimization, providing better use and greater scalability.

Short code

private $socket;

private $server;

 
public  function  __construct($server, $port =  7777)

{

$this->server = [$server, $port];

$this->socket =  $this->initializeSocket();

  

if (!$this->socket) {

$this->server['online'] =  false;

return;

}

  

$this->sendInitialPacket();

$this->server['online'] =  $this->verifyServer();

}

How to use it

Install

composer require jhonatanjavierdev/sampquery

Use it

<?php

$serverIP = 'ip'; $serverPort = 7777;
$sampQuery = new  SampQuery($serverIP, $serverPort);