29.06.2013, 07:43
Hi again. I ask a question here which is about loops.
I got this loop:
Which adds up all commands in a list like this:
and so on.
What I want is to make the loop count +5 everytime it finishes.
So that I can change the command format to:
Any help is accepted.
EDIT: Also, how do I check if the "Command_GetNext" returns nothing, so that I don't end up with:
if there's only 2 commands available.
I got this loop:
pawn Код:
for (new i = 0; i != count; ++i)
{
format(string,sizeof(string),"/%s",Command_GetNext(i, playerid));
SendInfoMessage(playerid, string);
}
Код:
/commands /help /admins
What I want is to make the loop count +5 everytime it finishes.
So that I can change the command format to:
pawn Код:
for (new i = 0; i != count; ++i)
{
format(string,sizeof(string),"/%s /%s /%s /%s /%s",Command_GetNext(i, playerid),Command_GetNext(i+1, playerid),Command_GetNext(i+2, playerid),Command_GetNext(i+3, playerid),Command_GetNext(i+4, playerid));
SendInfoMessage(playerid, string);
}
EDIT: Also, how do I check if the "Command_GetNext" returns nothing, so that I don't end up with:
pawn Код:
/help /commands / / /