SA-MP Forums Archive
it prints over 40 times? - 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)
+--- Thread: it prints over 40 times? (/showthread.php?tid=551764)



it prints over 40 times? - .Mento - 20.12.2014

I am setting a timer to play a sound, but it plays over 40 times, I added a: print("check"); and it prints over 40 times also.

I am setting this timer:

Код:
SetTimerEx("PlaySoundx", 10000, false, "i", playerid);
I have added print before and after setting the timer, to see if it sets the timer multiple times, but it doesn't...
Does anyone know why this happens?

the function:
Код:
public PlaySoundx(playerid)
{
    print("check");
    PlayerPlaySound(playerid, 1054, 0.0, 0.0, 0.0);
    return 1;
}
edit:

it executes PlaySoundx 510 times..


Re: it prints over 40 times? - RedFusion - 20.12.2014

You're probably setting the timer inside a loop of some kind, could you show us more of the code?


Re: it prints over 40 times? - .Mento - 20.12.2014

It's not in a loop, I've added a print before the timer and afterwards, and these print just once like they should.


Re: it prints over 40 times? - Blademaster680 - 21.12.2014

Can you show use where you are using "PlaySoundx(playerid)" please.
It might be that it is using that function over and over