12.01.2011, 13:32
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.
Thanks in advance. Forgive the indentation i copy pasted it from a nested block of code.
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");