evilfreelancer/samp-api-php

GTA San Andreas 多人游戏 PHP 客户端,用于与远程控制台协同工作

dev-master 2020-04-13 22:38 UTC

This package is auto-updated.

Last update: 2024-09-14 09:05:56 UTC


README

一个简单的 PHP 客户端,用于 San Andreas 多人游戏服务器,可以在远程控制台上执行命令。

composer require evilfreelancer/samp-api-php

如何使用

<?php
require_once __DIR__ . '/../vendor/autoload.php';

$config = new \SampApi\Config([
    'server'   => 'localhost',
    'port'     => '7777',
    'password' => '12345',
]);
$client = new \SampApi\Rcon($config);

// Get list of vars (only this method is ready for right now)
$response = $client->getVarlist();
dump($response);

// Another way
$response = $client->send('varlist');
dump($response);

// Yet another way, OOP style
$client->responseModel = true;
$response = $client->getVarlist();
dump($response);

所有可用命令的列表可以在这里找到。

链接

文档和重要链接

替代品