24.10.2017, 19:41
fiz esse codigo bem basico, dps de uma estudada pela board, mas preciso de uma ajuda.
o player esta perto de mim e eu dou o comando. ele vai escutar junto cmg ate uns 10 metros
mas c ele for mais longe q isso ainda continua, queria fazer uma verificaзao com settime pra dps q ele passar dos 10 Metros a musica parar de tocar
DIALOG
Comando
o player esta perto de mim e eu dou o comando. ele vai escutar junto cmg ate uns 10 metros
mas c ele for mais longe q isso ainda continua, queria fazer uma verificaзao com settime pra dps q ele passar dos 10 Metros a musica parar de tocar
DIALOG
Код:
if (dialogid == SomAutomotivo)
{
if (response)
{
if(!strlen(inputtext)){
SendClientMessage(playerid, Vermelho, "Nenhum url foi digitado na Box!");
return 0;
}
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0],Pos[1], Pos[2]);
for(new i = 0; i <MAX_PLAYERS; i++){
if(IsPlayerInRangeOfPoint(i, 10.0, Pos[0], Pos[1], Pos[2])){
PlayAudioStreamForPlayer(i, inputtext);
}
}
}else{
}
}
Код:
// Som Automotivo
CMD:tocarsom(playerid,params[])
{
if(pAusente[playerid] == true) return pMensagem(playerid, Vermelho, "-ERRO- Vocк estб ausente.");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, Vermelho, "Vocк nгo estб em um veнculo!");
ShowPlayerDialog(playerid, SomAutomotivo, DIALOG_STYLE_INPUT, "SomAutomotivo", "Cole aqui o endereзo do audio.", "Tocar", "Cancelar");
return 1;
}
CMD:pararaudio(playerid)
{
if(pAusente[playerid] == true) return pMensagem(playerid, Vermelho, "-ERRO- Vocк estб ausente.");
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
for(new i = 0; i < MAX_PLAYERS; i++){
if(IsPlayerInRangeOfPoint(i, 10.0,Pos[0],Pos[1],Pos[2])){
StopAudioStreamForPlayer(playerid);
}
}
return 1;
}


