PlayerPlaySoundEx can i do it for all players?
#8

Quote:
Originally Posted by Daren_Jacobson
again, done in reply box.
pawn Код:
for(new bob; bob < MAX_PLAYERS; bob++)
{
if (!IsPlayerConnected) continue;
PlayerPlaySound(bob, soundid);
}
That won't work since you are missing the coords...

You can:

1. Make a function 'PlaySoundForAll' by adding this at the top of your script:
pawn Код:
#define PlaySoundForAll(%1) for(new i; i < MAX_PLAYERS; i++) PlayerPlaySound(i, %1, 0.0, 0.0, 0.0)
/*%1 is the sound ID... */
or 2. Use this everytime you want to play the sound (should work faster by a few milliseconds :P):

pawn Код:
for(new i; i < MAX_PLAYERS; i++) PlayerPlaySound(i, soundid, 0.0, 0.0, 0.0); /* Replace 'soundid' with the ID you want */
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)