30.06.2013, 16:36
Now I have this command:
Which sends the string each time the loop starts over. And if I change it to:
I end up with getting only 1 row of commands.
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;
}
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;
}