Client Message Spams - 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: Client Message Spams (
/showthread.php?tid=632062)
Client Message Spams -
LazzyBoy - 08.04.2017
Hello there,
Currently i was scripting something and while i send message to player it Spams like 10 times then stops so basicly i just need only 1 message ., i use SendError but even if i switch it to SendClientMessage same thing happens
here's the code.
https://pastebin.com/FNJdbMkt
Re: Client Message Spams -
LEOTorres - 08.04.2017
Use break; to disengage from the loop after you have sent the necessary message or if you need to loop other features continuously, place the messages outside of the loop.
Re: Client Message Spams -
1fret - 08.04.2017
show your coding
Re: Client Message Spams -
LazzyBoy - 08.04.2017
are you blind bro.
Re: Client Message Spams -
DobbysGamertag - 08.04.2017
What is it you're trying to accomplish, before i go breaking something by fixing your indenting, and code.
Re: Client Message Spams -
LazzyBoy - 08.04.2017
nevermind.
Re: Client Message Spams -
Sew_Sumi - 09.04.2017
Quote:
Originally Posted by LEOTorres
Use break; to disengage from the loop after you have sent the necessary message or if you need to loop other features continuously, place the messages outside of the loop.
|
He doesn't need to use break, all he needs to do is make the loop not happen unless he actually puts code in. Although, there are multiple places that this spam will occur, and it's not just for a fail, so in the end, he needs to revise his code overall.
The reason your code is spamming, is because the SendClientMessages for the player, are in the for loop. That's why.