Str split/strcat help with ycmd
#1

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(playeridparams[], help)
{
    if (
help)
    {
        
SendClientMessage(playerid0xFF0000AA"Lists all the commands a player can use.");
    }
    else
    {
        new
            
count Command_GetPlayerCommandCount(playerid);
        for (new 
0!= count; ++i)
        {
            
SendClientMessage(playerid0xFF0000AACommand_GetNext(iplayerid));
        }
    }
    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.
Reply
#2

PHP код:
if(i%15){
strcat(newVarWithLineBreakvarWithCMDlist128);

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.
Reply
#3

that doesn't work it out puts

cmd
cmd
cmd
cmd cmd
cmd
cmd cmd
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)