RE: VOIP crash - welmateus - 07/05/2024
(06/05/2024 23:12)BitSain Escreveu: Pode ser, pode não ser.
Nos envie aqui também as 2 funções do SAMPVOICE (3.0) do seu código aqui (KeyPress e KeyRelease).
Código: 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 && FrequenciaConectada[playerid] >= 1){
if(!IsPlayerAttachedObjectSlotUsed(playerid, 9)) SetPlayerAttachedObject(playerid, 9, 19942, 2, 0.0300, 0.1309, -0.1060, 118.8998, 19.0998, 164.2999);
SvAttachSpeakerToStream(Frequencia[FrequenciaConectada[playerid]], playerid);
format(gstring, sizeof(gstring), "*[%d] esta falando no radio*", PlayerInfo[playerid][IDF]);
ProxDetector(15.0, playerid, gstring, COR_PURPLE,COR_PURPLE,COR_PURPLE,COR_PURPLE,COR_PURPLE);
for(new i; i < 46; i++)
{
TextDrawShowForPlayer(playerid, RadioTD[i]);
}
PlayerTextDrawShow(playerid, RadioPTD[playerid][0]);
}
else if (keyid == 0x42 && lstream[playerid]) SvAttachSpeakerToStream(lstream[playerid], playerid); FalandoVoip[playerid] = 1;
// 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 && FrequenciaConectada[playerid] >= 1){
SvDetachSpeakerFromStream(Frequencia[FrequenciaConectada[playerid]], playerid);
if(IsPlayerAttachedObjectSlotUsed(playerid, 9)) RemovePlayerAttachedObject(playerid, 9);
for(new i; i < 46; i++)
{
TextDrawHideForPlayer(playerid, RadioTD[i]);
}
PlayerTextDrawHide(playerid, RadioPTD[playerid][0]);
}
else if (keyid == 0x42 && lstream[playerid]) SvDetachSpeakerFromStream(lstream[playerid], playerid); FalandoVoip[playerid] = 0;
// Detach the player from the global stream if the 'Z' key is released
if (keyid == 0x5A && gstream) SvDetachSpeakerFromStream(gstream, playerid);
}
RE: VOIP crash - BitSain - 07/05/2024
Código PHP: 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 && FrequenciaConectada[playerid] >= 1){ if(!IsPlayerAttachedObjectSlotUsed(playerid, 9)) SetPlayerAttachedObject(playerid, 9, 19942, 2, 0.0300, 0.1309, -0.1060, 118.8998, 19.0998, 164.2999); SvAttachSpeakerToStream(Frequencia[FrequenciaConectada[playerid]], playerid); format(gstring, sizeof(gstring), "*[%d] esta falando no radio*", PlayerInfo[playerid][IDF]); ProxDetector(15.0, playerid, gstring, COR_PURPLE,COR_PURPLE,COR_PURPLE,COR_PURPLE,COR_PURPLE); for(new i; i < 46; i++) { TextDrawShowForPlayer(playerid, RadioTD[i]); } PlayerTextDrawShow(playerid, RadioPTD[playerid][0]); } else if (keyid == 0x42 && lstream[playerid]) SvAttachSpeakerToStream(lstream[playerid], playerid); FalandoVoip[playerid] = 1; // Attach the player to the global stream as a speaker if the 'Z' key is pressed
else 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 && FrequenciaConectada[playerid] >= 1){ SvDetachSpeakerFromStream(Frequencia[FrequenciaConectada[playerid]], playerid); if(IsPlayerAttachedObjectSlotUsed(playerid, 9)) RemovePlayerAttachedObject(playerid, 9); for(new i; i < 46; i++) { TextDrawHideForPlayer(playerid, RadioTD[i]); } PlayerTextDrawHide(playerid, RadioPTD[playerid][0]); } else if (keyid == 0x42 && lstream[playerid]) SvDetachSpeakerFromStream(lstream[playerid], playerid); FalandoVoip[playerid] = 0; // Detach the player from the global stream if the 'Z' key is released
else if (keyid == 0x5A && gstream) SvDetachSpeakerFromStream(gstream, playerid); }
Aparentemente não há erros no código não.
Minha teoria é que esteja criando 2 streams no player, taquei apenas uns else's no código aí.
RE: VOIP crash - xbruno1000x - 07/05/2024
Comenta esses trechos em que você está dando attach em objetos no jogador e testa sem. Pode ser um conflito entre o VOIP e o sistema de acessórios.
|