13.01.2013, 05:04
If they don't work, try using PRESSED instead.
Just give it a try.
pawn Code:
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED(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);
}
else
{
//No need for getting positions here
StopAudioStreamForPlayer(playerid);
}
return 1;
}