SA-MP Forums Archive
PlayerPlaySound looping? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: PlayerPlaySound looping? (/showthread.php?tid=123877)



PlayerPlaySound looping? - Torran - 27.01.2010

Im trying to make a alarm sound, And i cant find a alarm sound, So im using blip sounds, But i want them to keep repeating,
How would i do that


Re: PlayerPlaySound looping? - MadeMan - 27.01.2010

Use a timer?

https://sampwiki.blast.hk/wiki/SetTimer
https://sampwiki.blast.hk/wiki/SetTimerEx


Re: PlayerPlaySound looping? - Torran - 27.01.2010

Wouldnt that lag the server if quite a few players?


Re: PlayerPlaySound looping? - MadeMan - 27.01.2010

Quote:
Originally Posted by Torran
Wouldnt that lag the server if quite a few players?
It shouldn't. Just don't set the interval too small.


Re: PlayerPlaySound looping? - Torran - 27.01.2010

I set it to 1 second, Just to see what it sounds like...
pawn Код:
dcmd_blip(playerid, params[])
{
    #pragma unused params
    #pragma unused playerid
    for(new i; i<GetMaxPlayers(); i++) PlayerPlaySound(i, 1058, 0.0, 0.0, 0.0);
    SetTimer("Alarm", 1000, 1);
    return 1;
}
SERVER: UNKNOWN COMMAND

Any ideas


Re: PlayerPlaySound looping? - MadeMan - 27.01.2010

Show your Alarm function.


Re: PlayerPlaySound looping? - Torran - 27.01.2010

Alexis Bledel


Re: PlayerPlaySound looping? - MadeMan - 27.01.2010

Quote:
Originally Posted by Torran
Alexis Bledel
??


Re: PlayerPlaySound looping? - Torran - 27.01.2010

Lol sorry, It didnt copy properly

pawn Код:
forward Alarm();
public Alarm()
{
  for(new i; i<GetMaxPlayers(); i++) PlayerPlaySound(i, 1058, 0.0, 0.0, 0.0);
}



Re: PlayerPlaySound looping? - mansonh - 27.01.2010

I assume you are standing near 0 0 0 ? which si the middle of the map.