[y_commands] /commands loop..
#7

Now I have this command:

pawn Код:
YCMD:commands(playerid, params[], help)
{
    if(help) return SendInfoMessage(playerid,"Shows all available commands to a certain player.");
    new count = Command_GetPlayerCommandCount(playerid);
    new string[128],str[128];
    format(string,sizeof(string),"List of commands for {a9c4e4}%s{FFFFFF}:",pName(playerid));
    SendInfoMessage(playerid,"Type /help [command] for more info.");
    SendInfoMessage(playerid,string);
    for (new i = 0; i < count; i+=5)
    {
        new buffer[YSI_MAX_STRING];
        buffer = Command_GetNext(i, playerid);
        format(str, sizeof (str), "%s /%s", str, buffer);
        SendInfoMessage(playerid, str);
    }
    return 1;
}
Which sends the string each time the loop starts over. And if I change it to:

pawn Код:
YCMD:commands(playerid, params[], help)
{
    if(help) return SendInfoMessage(playerid,"Shows all available commands to a certain player.");
    new count = Command_GetPlayerCommandCount(playerid);
    new string[128],str[128];
    format(string,sizeof(string),"List of commands for {a9c4e4}%s{FFFFFF}:",pName(playerid));
    SendInfoMessage(playerid,"Type /help [command] for more info.");
    SendInfoMessage(playerid,string);
    for (new i = 0; i < count; i+=5)
    {
        new buffer[YSI_MAX_STRING];
        buffer = Command_GetNext(i, playerid);
        format(str, sizeof (str), "%s /%s", str, buffer);
    }
        SendInfoMessage(playerid, str);
    return 1;
}
I end up with getting only 1 row of commands.
Reply


Messages In This Thread
[y_commands] /commands loop.. - by introzen - 29.06.2013, 07:43
Re: [y_commands] /commands loop.. - by introzen - 29.06.2013, 10:27
Re: [y_commands] /commands loop.. - by IstuntmanI - 29.06.2013, 10:29
Re: [y_commands] /commands loop.. - by introzen - 29.06.2013, 10:41
Re: [y_commands] /commands loop.. - by introzen - 30.06.2013, 16:01
Re: [y_commands] /commands loop.. - by introzen - 30.06.2013, 16:14
Re: [y_commands] /commands loop.. - by introzen - 30.06.2013, 16:36
Re: [y_commands] /commands loop.. - by introzen - 30.06.2013, 16:44
Re: [y_commands] /commands loop.. - by introzen - 30.06.2013, 17:04

Forum Jump:


Users browsing this thread: 1 Guest(s)