Dialog and massive help
#1

Hi everyone! I need to create a table in dialog like that thing:
sry for language on that picture, but as u can see there is a info about gas price on petrol stations over the state. How to create somthing like that using massives, not by typing every single string =/ please help!
There is a part of my code
PHP код:
for(new 0sizeof(mnpBizzInfo); b++)
                {
                    new 
azsinfo[sizeof(mnpBizzInfo)][100];
                    
format(azsinfo[b],sizeof(azsinfo[b]), "ÀÇÑ [¹%d] - Öåíà çà ëèòð $%d",b,azsBizzInfo[b][azsEntranceCost])
                    new 
commmsg[1830];
                    
format(commmsg,sizeof(commmsg), "/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/n%s",azsinfo[0],azsinfo[1],azsinfo[2],azsinfo[3],azsinfo[4],azsinfo[5],azsinfo[6],azsinfo[7],azsinfo[8],azsinfo[9],azsinfo[10],azsinfo[11],azsinfo[12],azsinfo[13],azsinfo[14],azsinfo[15],azsinfo[16],azsinfo[17],azsinfo[18],azsinfo[19],azsinfo[20]);
                    
ShowPlayerDialog(playerid,63DIALOG_STYLE_MSGBOX,"F.A.Q ïî êàìàíäàì ñåðâåðà"commmsg"Äàëåå""Çàêðûòü");
                } 
Reply
#2

my script is wrong and there are a bit of errors cos pawn doesnt respond "b" as a massive number in azsinfo[b], how to do it
Reply
#3

using strcat and format
Reply
#4

if you get the error that there are too many characters in one line you can reduce that
Example:
pawn Код:
format(commmsg,sizeof(commmsg), "/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/"
"n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/"
"n%s\/n%s\/n%s",azsinfo[0],azsinfo[1],azsinfo[2],azsinfo[3],azsinfo[4],azsinfo[5],azsinfo[6],azsinfo[7],azsinfo[8],azsinfo[9],azsinfo[10],azsinfo[11],azsinfo[12],azsinfo[13],azsinfo[14],azsinfo[15],azsinfo[16],azsinfo[17],azsinfo[18],azsinfo[19],azsinfo[20]);
Reply
#5

Quote:
Originally Posted by XStormiest
Посмотреть сообщение
using strcat and format
can u please give me a tutorial or a part of a code how to use it?
Reply
#6

Quote:
Originally Posted by DaRk_RaiN
Посмотреть сообщение
if you get the error that there are too many characters in one line you can reduce that
Example:
pawn Код:
format(commmsg,sizeof(commmsg), "/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/"
"n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/n%s\/"
"n%s\/n%s\/n%s",azsinfo[0],azsinfo[1],azsinfo[2],azsinfo[3],azsinfo[4],azsinfo[5],azsinfo[6],azsinfo[7],azsinfo[8],azsinfo[9],azsinfo[10],azsinfo[11],azsinfo[12],azsinfo[13],azsinfo[14],azsinfo[15],azsinfo[16],azsinfo[17],azsinfo[18],azsinfo[19],azsinfo[20]);
how to reduce it?
Reply
#7

for example

Код:
   new str[256], string[256], astring[256];
   format(string,sizeof(string),"Here your formated text",here your float or whatever you want)
   format(astring,sizeof(astring),"as above",as above);
   strcat(str,string);
  strcat(str,astring);
     ShowPlayerDialog(playerid,25,DIALOG_STYLE_MSGBOX,"Dialog",str,"Ok","");
but i think you understand what i want to say..
Reply
#8

thx) strcat combinates both as i get it right?
Reply
#9

yep combinate that 2 function , and you will do well your script , if you still not understand send me a P.M
Reply
#10

PHP код:
{
                    if(
== 0)
                    {
                        
format(strazs,sizeof(strazs), "ÀÇÑ [¹%d] - Öåíà çà ëèòð $%d",b,azsBizzInfo[b][azsEntranceCost]);
                    }
                    else if(
== 19)
                        {
                        
ShowPlayerDialog(playerid,63DIALOG_STYLE_MSGBOX,"Ìîíèòîðèíã öåí ÀÇÑ"strazs"""Çàêðûòü");
                    }
                    else
                    {
                        
format(azsinfo,sizeof(azsinfo), "\nÀÇÑ [¹%d] - Öåíà çà ëèòð $%d",b,azsBizzInfo[b][azsEntranceCost]);
                               
strcat(strazs,azsinfo);
                        }
                } 
I did it right?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)