SA-MP Forums Archive
Disabling a function in whole script - 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: Disabling a function in whole script (/showthread.php?tid=627061)



Disabling a function in whole script - YouHack - 23.01.2017

Hello,
I have an RP gamemode that has alot of StopAudioStreamForPlayer(playerid);
How to disable it if an admin is streaming a global song?
I use this : MusicAll = 0; / if(MusicAll == 0)
But it's too hard to place it before each StopAudioStreamForPlayer(playerid); in a 40k lines script
Please help


Re: Disabling a function in whole script - ThatFag - 23.01.2017

Make a command which makes MusicAll more than 0 and done if you mean that


Re: Disabling a function in whole script - YouHack - 23.01.2017

How a command will disable alot of StopAudioStreamForPlayer(playerid); functions in same time?


Re: Disabling a function in whole script - oMa37 - 23.01.2017

Press CTRL + H and replace StopAudioStreamForPlayer(playerid); with the check you want;

PHP код:
if(MusicAll == 0StopAudioStreamForPlayer(playerid); 
Is it really hard?


Re: Disabling a function in whole script - YouHack - 23.01.2017

Not this?
Quote:

if(MusicAll == 0) return StopAudioStreamForPlayer(playerid);




Re: Disabling a function in whole script - Sew_Sumi - 23.01.2017

Quote:
Originally Posted by YouHack
Посмотреть сообщение
Not this?
No, his simply stops the stream, and continues going on, yours will stop the stream, and that entire section of code.


Re: Disabling a function in whole script - YouHack - 23.01.2017

Ahh i also was wondering for a function that don't stop the code!
Thanks both, +rep guys you deserve it for fast reply!