PlayerPlaySound looping?
#1

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
Reply
#2

Use a timer?

https://sampwiki.blast.hk/wiki/SetTimer
https://sampwiki.blast.hk/wiki/SetTimerEx
Reply
#3

Wouldnt that lag the server if quite a few players?
Reply
#4

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.
Reply
#5

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
Reply
#6

Show your Alarm function.
Reply
#7

Alexis Bledel
Reply
#8

Quote:
Originally Posted by Torran
Alexis Bledel
??
Reply
#9

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);
}
Reply
#10

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


Forum Jump:


Users browsing this thread: 3 Guest(s)