SA-MP Forums Archive
Extra line in dialog - 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: Extra line in dialog (/showthread.php?tid=602188)



Extra line in dialog - saffierr - 03.03.2016

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


Re: Extra line in dialog - Chilli9434 - 03.03.2016

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")


Re: Extra line in dialog - saffierr - 03.03.2016

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.


Re: Extra line in dialog - Chilli9434 - 03.03.2016

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;
}



Re: Extra line in dialog - DTV - 03.03.2016

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;