07/05/2024 08:10
(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);
}