PlayAudioStream Help
#1

Hi Guys.In my Fs Work And Play And Stop Audio But Not Again Repeat play and stop just play 1 Time How Can i Do ?
This is Code :
Код:
#include <a_samp>

new OneTimeOnly[MAX_PLAYERS];


public OnPlayerUpdate(playerid)
{
if(OneTimeOnly[playerid] == 0)
{
if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, 1, -2141.1802, -151.0720, 35.3359))
{
PlayAudioStreamForPlayer(playerid, "http://dl3.bia2rap20.info/Full/Fadaei/Fadaei_Hamseda_64.mp3");
OneTimeOnly[playerid] = 1;
}
} else {
if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, 1, -2141.1885, -156.1039, 35.3203))
{
StopAudioStreamForPlayer(playerid);
}
}
return 1;
}
Reply
#2

Any One Cant Help Me ?
Reply
#3

You forgot to set the OneTimeOnly back to 0 again, I think.

Код:
#include <a_samp>

new OneTimeOnly[MAX_PLAYERS];


public OnPlayerUpdate(playerid)
{
if(OneTimeOnly[playerid] == 0)
{
if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, 1, -2141.1802, -151.0720, 35.3359))
{
PlayAudioStreamForPlayer(playerid, "http://dl3.bia2rap20.info/Full/Fadaei/Fadaei_Hamseda_64.mp3");
OneTimeOnly[playerid] = 1;
}
} else {
if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, 1, -2141.1885, -156.1039, 35.3203))
{
StopAudioStreamForPlayer(playerid);
OneTimeOnly[playerid] = 0;
}
}
return 1;
}
Reply
#4

Quote:
Originally Posted by Matt
Посмотреть сообщение
You forgot to set the OneTimeOnly back to 0 again, I think.

Код:
#include <a_samp>

new OneTimeOnly[MAX_PLAYERS];


public OnPlayerUpdate(playerid)
{
if(OneTimeOnly[playerid] == 0)
{
if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, 1, -2141.1802, -151.0720, 35.3359))
{
PlayAudioStreamForPlayer(playerid, "http://dl3.bia2rap20.info/Full/Fadaei/Fadaei_Hamseda_64.mp3");
OneTimeOnly[playerid] = 1;
}
} else {
if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, 1, -2141.1885, -156.1039, 35.3203))
{
StopAudioStreamForPlayer(playerid);
OneTimeOnly[playerid] = 0;
}
}
return 1;
}
Ty I Rep You <3
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)