Str split/strcat help with ycmd - 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: Str split/strcat help with ycmd (
/showthread.php?tid=533930)
Str split/strcat help with ycmd -
r3ct - 27.08.2014
I am using ycmd and trying to use the example that ***** gave so when you do /commands it displays all commands and its a cmd you never have to update
PHP код:
YCMD:commands(playerid, params[], help)
{
if (help)
{
SendClientMessage(playerid, 0xFF0000AA, "Lists all the commands a player can use.");
}
else
{
new
count = Command_GetPlayerCommandCount(playerid);
for (new i = 0; i != count; ++i)
{
SendClientMessage(playerid, 0xFF0000AA, Command_GetNext(i, playerid));
}
}
return 1;
}
the output of that is
/cmd1
/cmd2
/cmd3
/cmd4
/cmd5
but how could I make it so like 15 commands show up in one line then another 15 in the next and so on instead of all in one line? I know this is possible using strcat but im just not sure exactly how it would be done.
Re: Str split/strcat help with ycmd -
Dotayuri - 27.08.2014
PHP код:
if(i%15){
strcat(newVarWithLineBreak, varWithCMDlist, 128);
}
15 commands may be to long!
Please look at the wiki
https://sampwiki.blast.hk/wiki/Limits
Look at (Text I/O) the max is 128 keep that in mine.
Re: Str split/strcat help with ycmd -
r3ct - 27.08.2014
that doesn't work it out puts
cmd
cmd
cmd
cmd cmd
cmd
cmd cmd