Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #include <a_samp>
- #include <sampvoip>
- //Microfone
- new SV_DLSTREAM:pstream[MAX_PLAYERS] = SV_NULL;
- new StreamCreate[MAX_PLAYERS];
- public SV_BOOL:OnPlayerVoice(SV_UINT:playerid, SV_PACKET:packet, SV_UINT:volume)
- {
- if(StreamCreate[playerid])
- sv_send_packet(packet, pstream[playerid]);
- SetPlayerChatBubble(playerid, "((x)) Falando ((x))", 0x9acd32FF, 20.0, 100000);
- return SV_TRUE; // Delete the packet? (SV_TRUE - yes, SV_FALSE - no)
- }
- public OnFilterScriptInit()
- {
- print("\n----------------------------------------------------------------------------");
- print(" Filterscript SAMPVOIP carregado com sucesso!");
- print(" |");
- print(" |__> Por Dudu_Insane V0.1");
- print("----------------------------------------------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- forward CarregarMicrofone(playerid);
- public CarregarMicrofone(playerid)
- {
- if(sv_get_version(playerid) == SV_NULL)
- ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "{FFFF00}SAMPVOIP", "{F60000}INFO: {C9C9C9} Voce nao tem o SAMPVOIP instalado em seu dispositivo, baixe-o em discord.gg/playvicio - ABA VOIP!", "Fechar", "");
- else if(sv_get_version(playerid) < SV_VERSION)
- ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "{FFFF00}SAMPVOIP", "{F60000}INFO: {C9C9C9} Voce esta usando uma versao desatualizada do plugin, atualize-o em discord.gg/playvicio - ABA VOIP", "Fechar", "");
- else
- {
- // Checando microfone
- if(!sv_has_micro(playerid))
- ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "{FFFF00}SAMPVOIP", "{F60000}INFO: {C9C9C9} Nao conseguimos detectar seu microfone.", "Fechar", "");
- // Instalacao do microfone do player
- pstream[playerid] = sv_dlstream_create_at_player(playerid);
- sv_set_key(playerid, 0x42);
- StreamCreate[playerid] = true;
- SendClientMessage(playerid, -1, "[PlayVicio]: {FFFFFF}Voce conectou-se com sucesso ao {FFFF00}SAMPVOIP{FFFFFF} do PlayVicio, segure '{F60000}B{FFFFFF}' para falar!");
- }
- }
- public OnPlayerConnect(playerid)
- {
- StreamCreate[playerid] = false;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(StreamCreate[playerid])
- {
- sv_stream_delete(pstream[playerid]);
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(!StreamCreate[playerid])
- CarregarMicrofone(playerid);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement