Extra line in dialog
#1

Is it possible to add a extra line into a dialog with a cmd IG?
if yes, What is the function of it?
Reply
#2

I guess string manipulation could do this. Like

format(string, sizeof(string), "Info section");
format(string, sizeof(string), "%s\n", string);

then just show the dialog but instead of a prepared info[] section, put the string variable

ShowPlayerDialog(playerid, DIALOG_X, DIALOG_STYLE_X, "x", string, "x","x")
Reply
#3

I don't fully understand you,
I want to add rules IG so whenever I have added a new rule with a cmd ig, I want the Rules dialog updated with the new line init.
Reply
#4

Quote:
Originally Posted by saffierr
Посмотреть сообщение
I don't fully understand you,
I want to add rules IG so whenever I have added a new rule with a cmd ig, I want the Rules dialog updated with the new line init.
To do this, you'll need to store the rules in a database somewhere. Then load them and do something along these lines (Without any of your script its hard to explain what exactly you have to do)

((this code isnt complete, just to give you an idea of what to do))
Код:
format(msg, sizeof(msg), "");

for(new x=0; x<MAX_RULES; x++) {

format(string, sizeof(string), "%s%s", msg, rulevariable[ruleid][RuleName];
}

SendPlayerDialog(playerid, DIALOG_X, DIALOG_STYLE_X, "Title", msg, "Button1", "Button2");
return 1;
}
Reply
#5

You could use strcat to combine strings together.

pawn Код:
new rules[128], string[128];
format(string, sizeof(string), "Rule 1: x\n");
strcat(rules, string);
format(string, sizeof(string), "Rule 1: x\n");
strcat(rules, string);
ShowPlayerDialog(playerid, dialogid, dialogstyle, "Dialog Caption", rules, "Button 1", "Button 2");
return 1;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)