filterscript samp voip not working
# support-forum
c
A lot of players ask me voip on server... I tried to follow the docs and make a filterscript to put it on the server It is detecting who has and who doesn't have sampvoip But when someone speaks, no one listens Why? What i did wrong? I did it:
Copy code
c++
#include <a_samp>
#include <sampvoice>

// local chat player 1
new SV_LSTREAM:lstream[MAX_PLAYERS] = { SV_NULL, ... };

public SV_VOID:OnPlayerActivationKeyPress(SV_UINT:playerid, SV_UINT:keyid)
{
    // Press 'B'
    // local chat player 2
    if (keyid == 0x42 && lstream[playerid]) {
        SvAttachSpeakerToStream(lstream[playerid], playerid);
    }
}

public SV_VOID:OnPlayerActivationKeyRelease(SV_UINT:playerid, SV_UINT:keyid)
{
    // Release 'B'
    if (keyid == 0x42 && lstream[playerid]) {
        SvDetachSpeakerFromStream(lstream[playerid], playerid);
    }
}

public OnPlayerConnect(playerid) {
    // Checking for plugin availability
    if (SvGetVersion(playerid) == SV_NULL)
    {
        // Could not find plugin sampvoice.
        SetPVarInt(playerid, "hasVoiceOnClient", 0);
    }
    // Checking for a microphone
    else if (SvHasMicro(playerid) == SV_FALSE)
    {
        // The microphone could not be found.
        SetPVarInt(playerid, "hasVoiceOnClient", 2);
    }
    // Create a local stream with an audibility distance of 40.0, an unlimited number of listeners
    // and the name 'Local' (the name 'Local' will be displayed in red in the players' speakerlist)
    else if ((lstream[playerid] = SvCreateDLStreamAtPlayer(40.0, SV_INFINITY, playerid, 0xff0000ff, "Local")))
    {
        // Assign microphone activation keys to the player
        SvAddKey(playerid, 0x42); // B

        //
        SetPVarInt(playerid, "hasVoiceOnClient", 1);
    }
}
public OnPlayerDisconnect(playerid, reason) {
    // Removing the player's local stream after disconnecting
    if (lstream[playerid])
    {
        SvDeleteStream(lstream[playerid]);
        lstream[playerid] = SV_NULL;
    }
}
m
check if the plugin loads correctly
c
what are u mean? when server starts?
Copy code
[10:56:56] Filterscripts
[10:56:56] ---------------
[10:56:56]   Loading filterscript 'android-checker.amx'...
[10:56:56] [sv:dbg:main:AmxLoad] : net game pointer (value:0x990c460) received
[10:56:56] [sv:dbg:network:bind] : voice server running on port 50507
[10:56:56] Android check has been successfully loaded.
[10:56:56]   Loading filterscript 'sampvoice.amx'...
[10:56:56]   Loaded 2 filterscripts.
the
SetPVarInt(playerid, "hasVoiceOnClient"
are working only the voice is not working, i can see who has voice installed, but when they talk, no one can listen
m
what are you using to run ur server
ogp, pterodactyl?
g
are u by chance using openmp or samp server
c
what is it?
i just using ./samp03svr
i'm using samp server
g
does it work on localhost?
5 Views