What are best practices for interacting with a TS server using PHP, such as giving and taking SA, kicking, and banning?
When interacting with a TS server using PHP, it is important to use the appropriate TS3 PHP Framework to handle server queries. To give server admin (SA) privileges to a user, you can use the `serverGroupAddClient` function. To kick a user from the server, use the `clientKick` function. To ban a user, use the `banClient` function.
// Include the TS3 PHP Framework
require_once("libraries/TeamSpeak3/TeamSpeak3.php");
// Connect to the TS server
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://username:password@localhost:10011/?server_port=9987");
// Give SA to a user
$ts3_VirtualServer->serverGroupAddClient("serverAdminGroupID", "clientDatabaseID");
// Kick a user
$ts3_VirtualServer->clientKick("clientID", TeamSpeak3::KICK_SERVER, "Reason for kick");
// Ban a user
$ts3_VirtualServer->banClient("clientID", "banTimeInSeconds", "Reason for ban");