27.01.2010, 16:31
How would i do PlayerPlaySound for everyone
PlaySoundForAll(sound)
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i)) PlayerPlaySound(i,sound,0,0,0);
}
}
PlaySoundForAll(sound id);
for(new i; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { PlayerPlaySound(i, ...); } }
public PlaySoundForEveryone(soundid, Float:x, Float:y, Float:z) { for(new i = 0; i < MAX_PLAYERS; i ++) { if(IsPlayerConnected(i)) PlayerPlaySound(i, soundid, x, y, z); } }
Originally Posted by Mauzen
for example, this would do it:
Код:
public PlaySoundForEveryone(soundid, Float:x, Float:y, Float:z) { for(new i = 0; i < MAX_PLAYERS; i ++) { if(IsPlayerConnected(i)) PlayerPlaySound(i, soundid, x, y, z); } } Edit: Oops, too slow |
C:\Users\Torran\Desktop\sa-mp\gamemodes\b-cnr.pwn(848) : error 017: undefined symbol "PlaySoundForAll" C:\Users\Torran\Desktop\sa-mp\gamemodes\b-cnr.pwn(852) : warning 217: loose indentation C:\Users\Torran\Desktop\sa-mp\gamemodes\b-cnr.pwn(852) : error 017: undefined symbol "PlaySoundForAll" C:\Users\Torran\Desktop\sa-mp\gamemodes\b-cnr.pwn(856) : error 017: undefined symbol "sound" C:\Users\Torran\Desktop\sa-mp\gamemodes\b-cnr.pwn(859) : error 030: compound statement not closed at the end of file (started at line 845) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
for(new i; i<MAX_PLAYERS, i++){
if(IsPlayerConnected(i) PlayerPlaySound(i, soundid, 0.0, 0.0, 0.0);
}