Should i use "format" for this??
#1

Hello i was wondering if anyone would know a better (more efficient) way of adding text to a string than format? I know about "strins" but i can't specify which posistion to insert the text. I've never needed to do this up untill now so i'm a bit stumped. Here is the code to give you an idea of what i mean, incase you didn't get it.

Its using y_groups/y_commands so keep in mind this function "Command_GetNext(i, playerid)" just returns a command name.
pawn Код:
new
            cmdlist[264],
            cmdcount = Command_GetPlayerCommandCount(playerid);
        for(new i; i < cmdcount; i++)
        {
            format(cmdlist, sizeof(cmdlist), "%s/%s\n", cmdlist, Command_GetNext(i, playerid));//i wont know where to insert the new command with strins
        }
        ShowPlayerDialog(playerid, COMMAND_DIALOG, DIALOG_STYLE_LIST, "{00ff01}Here is a list of all commands available to you", cmdlist, "Ok","Back");
Thanks in advance. Forgive the indentation i copy pasted it from a nested block of code.
Reply


Messages In This Thread
Should i use "format" for this?? - by iggy1 - 12.01.2011, 13:32
Re: Should i use "format" for this?? - by Jeffry - 12.01.2011, 13:35
Re: Should i use "format" for this?? - by iggy1 - 12.01.2011, 13:39
Re: Should i use "format" for this?? - by Jeffry - 12.01.2011, 13:45
Re: Should i use "format" for this?? - by RyDeR` - 12.01.2011, 13:49
Re: Should i use "format" for this?? - by iggy1 - 12.01.2011, 13:51
Re: Should i use "format" for this?? - by Finn - 12.01.2011, 13:58
Re: Should i use "format" for this?? - by iggy1 - 12.01.2011, 14:09

Forum Jump:


Users browsing this thread: 1 Guest(s)