SA-MP Forums Archive
Long DialogBox - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Long DialogBox (/showthread.php?tid=246725)



Long DialogBox - Peep - 05.04.2011

Hello,

I made a code to make a long dialog box, but it fails. Can somebody help me with it ?

Код:
new string[512];
new text[] = "{FFB300}[%s Stats]";
new text2[] = "{FFB300}|>Money-----<| Money: [$%d] Bank: [$%d] Adminlevel: [%d] Ph: []",Cash,Bank,Admin;
new text3[] = "{FFB300}|>Charachter<| Skin: [%d] Sex: [] Age: [] Organisation:[] Rank:[] Job:[%s]",Skin,Job;
new text4[] = "{FFB300}|>Items-----<| Drugs:[%d]  Materials:[] LottoNr:[] Smokes:[] Lighter:[] Goods:[] Drugmats:[] DrugComp:[]",Drugs;
new text5[] = "{FFB300}|>Skills----<| Muscle:[] Stamina:[] /education  /Licenses /joblicenses";
new text6[] = "{FFB300}|>Stats-----<| Level:[%d] Respect:[] PlayingHours:[] DonateRank:[] Warns:[]",Level;
format(string,sizeof(string),"%s %s %s %s %s %s",text,text2,text3,text4,text5,text6);
ShowPlayerDialog(playerid,10000,DIALOG_STYLE_MSGBOX, "Stats",string,"Close","");
Thanks,


Re: Long DialogBox - Sascha - 05.04.2011

pawn Код:
new string[512], text[200], text2[200], text3[200], text4[200], text5[200], text6[200];
format(text, sizeof(text), "{FFB300}[%s Stats]");           //missing of the string definitions %s
format(text2, sizeof(text2), "{FFB300}|>Money-----<| Money: [$%d] Bank: [$%d] Adminlevel: [%d] Ph: []",Cash,Bank,Admin);
format(text3, sizeof(text3), "{FFB300}|>Charachter<| Skin: [%d] Sex: [] Age: [] Organisation:[] Rank:[] Job:[%s]",Skin,Job);
format(text4, sizeof(text4), "{FFB300}|>Items-----<| Drugs:[%d]  Materials:[] LottoNr:[] Smokes:[] Lighter:[] Goods:[] Drugmats:[] DrugComp:[]",Drugs);
format(text5, sizeof(text5), "{FFB300}|>Skills----<| Muscle:[] Stamina:[] /education  /Licenses /joblicenses");
format(text6, sizeof(text6), "{FFB300}|>Stats-----<| Level:[%d] Respect:[] PlayingHours:[] DonateRank:[] Warns:[]",Level);
format(string, sizeof(string), "%s\n%s\n%s\n%s\n%s\n%s", text, text2, text3, text4, text5, text6);
ShowPlayerDialog(playerid, 10000, DIALOG_STYLE_MSGBOX, "Stats", string, "Close", "");



Re: Long DialogBox - -Rebel Son- - 05.04.2011

sascha, Nice code, But strcat is more efficient.

PHP код:
    new sstring[12][164];
    new 
fstring[2000];
    
strcat(sstring[0], "code\n");
    
strcat(sstring[1], "code\n");
    
strcat(sstring[2], "code\n");
    
strcat(sstring[3], "code\n");
    
strcat(sstring[5], "code\n");
    
strcat(sstring[6], "code\n");
    
strcat(sstring[7], "code\n");
    
format(fstringsizeof fstring"\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",sstring[0],sstring[1],sstring[2],sstring[3],sstring[4],sstring[5],sstring[6],sstring[7]);
    
ShowPlayerDialog(playeridDIALOGIDDIALOG_STYLE_MSGBOX"info",fstring"Exit""Exit"); 



Re: Long DialogBox - Peep - 05.04.2011

Thanks ! All works well !


Re: Long DialogBox - -Rebel Son- - 05.04.2011

No problem, PM-Me if you have anymore questions.