SA-MP Forums Archive
Loop this messages - 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: Loop this messages (/showthread.php?tid=307260)



Loop this messages - Face9000 - 29.12.2011

Hi guys,i need a tip,i forgot how to loop the messages instead of creating tons of lines.

I've this:

pawn Код:
SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
    SendClientMessage(playerid,COLOR_CUSTARD, "*");
How to write all in 1 line and send it instead of writing all this lines?


Re: Loop this messages - Norck - 29.12.2011

pawn Код:
for(new i; i < 10; i++)  // 10 = amount of messages that you need to send
    SendClientMessage(playerid,COLOR_CUSTARD,"*");



Re: Loop this messages - Face9000 - 29.12.2011

Thanks (:


Re: Loop this messages - fordawinzz - 29.12.2011

you can use this:
pawn Код:
stock SendBlankMessage(playerid, times)
{
    for(new i = 0; i < times; i++)
    {
        SendClientMessage(playerid, COLOR_CUSTARD, "*");
    }
    return 1;
}