PHP Code:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#define vermelho 0xFF0000AA
CMD:voice(playerid, params[])
{
new Texto[200],
stringtexto[300];
if (sscanf(params, "s", Texto)) return SendClientMessage(playerid, vermelho, "[ERRO]: /voice [Text]");{
new Float:PosX,
Float:PosY,
Float:PosZ;
GetPlayerPos(playerid, PosX, PosY, PosZ);
for (new i;i<MAX_PLAYERS;++i){
if (IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i, 30.0, PosX, PosY, PosZ)){
format(stringtexto, sizeof(stringtexto), "https://translate.******.com/translate_tts?ie=UTF-8&q= %s &tl=pt-TW&client=tw-ob",Texto);
PlayAudioStreamForPlayer(i, stringtexto);
PlayerPlaySound(i,1057,0.0,0.0,0.0);
}
}
}
return 1;
}