for (new i = 0; i != count; ++i)
{
format(string,sizeof(string),"/%s",Command_GetNext(i, playerid));
SendInfoMessage(playerid, string);
}
/commands /help /admins
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);
}
/help /commands / / /
If "Command_GetNext" returns nothing, then the return will be empty:
pawn Код:
|
for (new i = 0; i != count; i += 5)
for (new i = 0; i < count; i+=4)
{
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);
}
/help /commands / / /
/veh / / / /
/%s /%s /%s /%s /%s
if(buffer[0]) { AddToString(str,"/%s",buffer[0]) } else {return 1;}
if(buffer[1]) { AddToString(str,"/%s",buffer[1]) } else {return 1;}
if(buffer[2]) { AddToString(str,"/%s",buffer[2]) } else {return 1;}
if(buffer[3]) { AddToString(str,"/%s",buffer[3]) } else {return 1;}
if(buffer[4]) { AddToString(str,"/%s",buffer[4]) } else {return 1;}
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;
}
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;
}
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);
if(buffer[0] != 0) format(str, sizeof (str), "%s /%s", str, buffer);
buffer = Command_GetNext(i+1, playerid);
if(buffer[0] != 0) format(str, sizeof (str), "%s /%s", str, buffer);
buffer = Command_GetNext(i+2, playerid);
if(buffer[0] != 0) format(str, sizeof (str), "%s /%s", str, buffer);
buffer = Command_GetNext(i+3, playerid);
if(buffer[0] != 0) format(str, sizeof (str), "%s /%s", str, buffer);
buffer = Command_GetNext(i+4, playerid);
if(buffer[0] != 0) format(str, sizeof (str), "%s /%s", str, buffer);
SendInfoMessage(playerid, str);
format(str,sizeof(str),"");
}
return 1;
}