07.04.2012, 19:15
(
Последний раз редактировалось Killa[DGZ]; 08.04.2012 в 00:38.
Причина: changed some code
)
Yeah no problem, as i said before it was just an small example.
You could change the code an just call it for the players needed, or even call it from a global one second timer for players that have just had an audio stream stopped for them as i do myself...
Even if it was integrated into the sa:mp client i still think it would require the two second delay, because just playing the two sounds one straight after the other like this...
Has absolutely no effect and doesn't fix your radio, i tested this and two seconds was as low as i could go to get "everyones" radio fixed "everytime" without any fails.
Edit: Just noticed that the two second delay fails for some players so i went up to a three second delay an all seems fine now, and another thing is this can make your client crash sometimes...so mabe its not such a good solution after all.
You could change the code an just call it for the players needed, or even call it from a global one second timer for players that have just had an audio stream stopped for them as i do myself...
pawn Код:
//at the top
new PlayerRadioReset[MAX_PLAYERS];
//under onplayerconnect
PlayerRadioReset[playerid] = 0;
//inside a global one second timer that has a max player loop
if(PlayerRadioReset[i] >= 1)
{
if(PlayerRadioReset[i] == 1)
{
PlayerPlaySound(i, 1068, 0.0, 0.0, 0.0);
}
PlayerRadioReset[i] += 1;
if(PlayerRadioReset[i] >= 4)
{
PlayerPlaySound(i, 1069, 0.0, 0.0, 0.0);
PlayerRadioReset[i] = 0;
}
}
//under any "StopAudioStreamForPlayer(playerid);" just add...
PlayerRadioReset[playerid] = 1;
Even if it was integrated into the sa:mp client i still think it would require the two second delay, because just playing the two sounds one straight after the other like this...
pawn Код:
PlayerPlaySound(playerid, 1068, 0.0, 0.0, 0.0);
PlayerPlaySound(playerid, 1069, 0.0, 0.0, 0.0);
Edit: Just noticed that the two second delay fails for some players so i went up to a three second delay an all seems fine now, and another thing is this can make your client crash sometimes...so mabe its not such a good solution after all.