22/07/2021 18:41
Boa noite estou com um erro na minha gm por conta do voip quando ligo a gm acontece isso:
E estou utilizando essa linha de codigos na minha FS.
Código:
==================
Loaded.
Loading plugin: sampvoice
[sv:dbg:network:init] : module initializing...
[dbg:raknet:init] : module initializing...
[dbg:raknet:init] : installed hook to 'GetRakServerInterface' function (ptr:00450220)
[dbg:raknet:init] : installed hook to 'OnPlayerDisconnect' function (ptr:0046D970)
[dbg:raknet:init] : module initialized
[sv:dbg:network:init] : module initialized
-------------------------------------------
___ __ __ _
/ __| __ _ _ __ _ _\ \ / /__ (_) __ ___
\__ \/ _` | ' \| '_ \ / _ \| |/ _/ -_)
|___/\__,_|_|_|_| .__/\_/\___/|_|\__\___|
|_|
-------------------------------------------
SampVoice by MOR loaded
-------------------------------------------
Loaded.
Loading plugin: cashdetect
Failed.
Loaded 6 plugins.
Started server on port: 7777, with maxplayers: 100 lanmode is OFF.
Filterscripts
---------------
Loading filterscript 'rcon.amx'...
[sv:dbg:main:AmxLoad] : net game pointer (value:02559B58) received
[sv:dbg:network:bind] : voice server running on port 62231
Loading filterscript 'bare.amx'...
Error: Function not registered: 'SvCreateGStream'
Error: Function not registered: 'SvDeleteStream'
Error: Function not registered: 'SvGetVersion'
Error: Function not registered: 'SvHasMicro'
Error: Function not registered: 'SvCreateDLStreamAtPlayer'
Error: Function not registered: 'SvAttachListenerToStream'
Error: Function not registered: 'SvAddKey'
Error: Function not registered: 'SvAttachSpeakerToStream'
Error: Function not registered: 'SvDetachSpeakerFromStream'
[sv:dbg:main:AmxLoad] : failed to bind voice server
Loaded 2 filterscripts.
Error: Function not registered: 'WP_Hash'
[sv:dbg:main:AmxLoad] : failed to bind voice server
Código:
#include <a_samp>
#include <sampvoice>
main() {}
new SV_GSTREAM:gstream = SV_NULL;
new SV_LSTREAM:lstream[MAX_PLAYERS] = { SV_NULL, ... };
public OnGameModeInit()
{
// Uncomment the line to enable debug mode
// SvDebug(SV_TRUE);
gstream = SvCreateGStream(0xffff0000, "Global");
}
public OnGameModeExit()
{
if (gstream) SvDeleteStream(gstream);
}
public OnPlayerConnect(playerid)
{
if(!SvGetVersion(playerid))
{
SendClientMessage(playerid, -1, "Seu VOIP não foi encontrado");
}
else if(!SvHasMicro(playerid))
{
SendClientMessage(playerid, -1, "VOIP: Seu microfone não foi carregado");
}
else if((lstream[playerid] = SvCreateDLStreamAtPlayer(40.0, SV_INFINITY, playerid, 0xff0000ff, "L")))
{
SendClientMessage(playerid, -1, "Seu VOIP foi carregado com sucesso!");
if (gstream) SvAttachListenerToStream(gstream, playerid);
SvAddKey(playerid, 0x5A);//Z
SvAddKey(playerid, 0x42);//B
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
// Removing the player's local stream after disconnecting
if (lstream[playerid])
{
SvDeleteStream(lstream[playerid]);
lstream[playerid] = SV_NULL;
}
return 1;
}
public SV_VOID:OnPlayerActivationKeyPress(SV_UINT:playerid, SV_UINT:keyid)
{
// Attach player to local stream as speaker if 'B' key is pressed
if (keyid == 0x42 && lstream[playerid]) SvAttachSpeakerToStream(lstream[playerid], playerid);
// Attach the player to the global stream as a speaker if the 'Z' key is pressed
if (keyid == 0x5A && gstream) SvAttachSpeakerToStream(gstream, playerid);
}
public SV_VOID:OnPlayerActivationKeyRelease(SV_UINT:playerid, SV_UINT:keyid)
{
// Detach the player from the local stream if the 'B' key is released
if (keyid == 0x42 && lstream[playerid]) SvDetachSpeakerFromStream(lstream[playerid], playerid);
// Detach the player from the global stream if the 'Z' key is released
if (keyid == 0x5A && gstream) SvDetachSpeakerFromStream(gstream, playerid);
}