Description:
The plugin will allow you to receive and send voice packets, creating voice systems. This opens up great opportunities for Pawn-developers.
Main features:
Simple example:
Binaries:
https://sampvoice.com/
The plugin will allow you to receive and send voice packets, creating voice systems. This opens up great opportunities for Pawn-developers.
Main features:
- Receiving voice packets
- Sending voice packets to specified players
- The plugin uses the BASS library and the OPUS codec
Simple example:
PHP Code:
#include <a_samp>
#include <voice>
#undef MAX_PLAYERS
#define MAX_PLAYERS 100
// PRESSED(keys)
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
// RELEASED(keys)
#define RELEASED(%0) \
(((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
// Press Y
if(PRESSED(KEY_YES)) StartVoice(playerid);
// Release Y
if(RELEASED(KEY_YES)) StopVoice(playerid);
return 1;
}
public OnPlayerVoice(playerid, BitStream:bs)
{
// Add Text
SetPlayerChatBubble(playerid, "Speaker", COLOR_WHITE, 10.00, 1000);
// Get Player Voice Pos
new Float:pos[3];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
// Foreach Players
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(playerid == i) continue;
if(!IsPlayerConnected(i)) continue;
// Set param 10.00 distance
if(IsPlayerInRangeOfPoint(i, 10.00, pos[0], pos[1], pos[2])) {
SendVoice(i, bs);
}
}
return 1;
}
https://sampvoice.com/