13.01.2013, 04:14
As the title of this topic says, I can't seem to get PlayAudioStreamForPlayer to work. Honestly, this damn function hardly ever works for me.
I have the audio file on two separate servers, neither one works.
This is my code:
It can also be found on: http://ls-gov.us/pd/dual_horn.mp3
As you can tell, both of them play.
Can someone else see if this code works for them?
I have run the code on the bare game-mode script on my localhost, as well as the same server as the infinitumgaming.com/sounds/dual_horn.mp3 sound is hosted on.
I'm stumped.
I have the audio file on two separate servers, neither one works.
This is my code:
pawn Code:
#include <a_samp>
#include <zcmd>
#define HOLDING(%0) \
((newkeys & (%0)) == (%0))
#define RELEASED(%0) \
(((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(HOLDING(KEY_SUBMISSION))
{
new Float:fPos[3];
GetPlayerPos(playerid, fPos[0], fPos[1], fPos[2]);
PlayAudioStreamForPlayer(playerid, "http://infinitumgaming.com/sounds/dual_horn.mp3", fPos[0], fPos[1], fPos[2], 30.0, 1);
}
if(RELEASED(KEY_SUBMISSION))
{
new Float:fPos[3];
GetPlayerPos(playerid, fPos[0], fPos[1], fPos[2]);
StopAudioStreamForPlayer(playerid);
}
return 1;
}
As you can tell, both of them play.
Can someone else see if this code works for them?
I have run the code on the bare game-mode script on my localhost, as well as the same server as the infinitumgaming.com/sounds/dual_horn.mp3 sound is hosted on.
I'm stumped.