SA-MP Forums Archive
Help me convert this to a 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: Help me convert this to a Dialog? (/showthread.php?tid=647202)



Help me convert this to a Dialog? - ChildVape - 31.12.2017

Код:
SendClientMessage(i, COLOR_WHITE, "|___ BANK STATEMENT ___|");
					format(string, sizeof(string), "  Paycheck: $%d", checks);
					SendClientMessage(i, COLOR_GRAD1, string);
					format(string, sizeof(string), "  Income Tax: -$%d", incometax);
					SendClientMessage(i, COLOR_GRAD1, string);
					if(PlayerInfo[i][pPbiskey] >= 1)
					{
					    format(string, sizeof(string), "  Business Electricity Bill: -$%d", ebill2);
						SendClientMessage(i, COLOR_GRAD1, string);
					}
     				format(string, sizeof(string), "  Rent: -$%d", rent);
					SendClientMessage(i, COLOR_GRAD1, string);
					format(string, sizeof(string), "  Balance: $%d", account);
					SendClientMessage(i, COLOR_GRAD1, string);
					if(PlayerInfo[i][pDonateRank] == 0)
					{
					    tmpintrate = tmpintrate/5;
					    format(string, sizeof(string), "  Interest rate: 0.%d percent",tmpintrate);
						SendClientMessage(i, COLOR_GRAD2, string);
	 				}
	 				else if(PlayerInfo[i][pDonateRank] == 1)
					{
                        tmpintrate = tmpintrate/5;
					    format(string, sizeof(string), "  Interest rate: 0.%d percent [Bronze VIP]",tmpintrate);
						SendClientMessage(i, COLOR_GRAD2, string);
	 				}
	 				else if(PlayerInfo[i][pDonateRank] == 2)
					{
					    tmpintrate = tmpintrate/5;
					    format(string, sizeof(string), "  Interest rate: 0.%d percent [Silver VIP]",tmpintrate);
						SendClientMessage(i, COLOR_GRAD2, string);
	 				}
	 				else if(PlayerInfo[i][pDonateRank] == 3)
					{
					    tmpintrate = tmpintrate/10;
					    format(string, sizeof(string), "  Interest rate: %d percent [Gold VIP]",tmpintrate);
						SendClientMessage(i, COLOR_GRAD2, string);
	 				}
      				else if(PlayerInfo[i][pDonateRank] == 4)
					{
					    tmpintrate = tmpintrate/10;
					    format(string, sizeof(string), "  Interest rate: %d percent [Platinium VIP]",tmpintrate);
						SendClientMessage(i, COLOR_GRAD2, string);
	 				}

  					else if(PlayerInfo[i][pDonateRank] == 5)
					{
					    tmpintrate = tmpintrate/10;
					    format(string, sizeof(string), "  Interest rate: %d percent [VIP Moderator]",tmpintrate);
						SendClientMessage(i, COLOR_GRAD2, string);
	 				}
					format(string, sizeof(string), "  Interest gained $%d", interest);
					SendClientMessage(i, COLOR_GRAD3, string);
					SendClientMessage(i, COLOR_GRAD4, "|------------------------------------------|");
					format(string, sizeof(string), "  New Balance: $%d", PlayerInfo[i][pAccount]);
					SendClientMessage(i, COLOR_GRAD5, string);



Re: Help me convert this to a Dialog? - RogueDrifter - 31.12.2017

PHP код:
                    new mydialogue[400];
                    
strcat(mydialog"|___ BANK STATEMENT ___|");
                    
format(stringsizeof(string), "\n\nPaycheck: $%d"checks);
                    
strcat(mydialog,string);
                    
format(stringsizeof(string), "\nIncome Tax: -$%d"incometax);
                    
strcat(mydialog,string);
                    if(
PlayerInfo[i][pPbiskey] >= 1)
                    {
                        
format(stringsizeof(string), "\nBusiness Electricity Bill: -$%d"ebill2);
                        
strcat(mydialog,string);
                    }
                     
format(stringsizeof(string), "\nRent: -$%d"rent);
                    
strcat(mydialog,string);
                    
format(stringsizeof(string), "\nBalance: $%d"account);
                    
strcat(mydialog,string);
                    if(
PlayerInfo[i][pDonateRank] == 0)
                    {
                        
tmpintrate tmpintrate/5;
                        
format(stringsizeof(string), "\ninterest rate: 0.%d percent",tmpintrate);
                        
strcat(mydialog,string);
                     }
                     else if(
PlayerInfo[i][pDonateRank] == 1)
                    {
                        
tmpintrate tmpintrate/5;
                        
format(stringsizeof(string), "\nInterest rate: 0.%d percent [Bronze VIP]",tmpintrate);
                        
strcat(mydialog,string);
                     }
                     else if(
PlayerInfo[i][pDonateRank] == 2)
                    {
                        
tmpintrate tmpintrate/5;
                        
format(stringsizeof(string), "\nInterest rate: 0.%d percent [Silver VIP]",tmpintrate);
                        
strcat(mydialog,string);
                     }
                     else if(
PlayerInfo[i][pDonateRank] == 3)
                    {
                        
tmpintrate tmpintrate/10;
                        
format(stringsizeof(string), "\nInterest rate: %d percent [Gold VIP]",tmpintrate);
                        
strcat(mydialog,string);
                     }
                      else if(
PlayerInfo[i][pDonateRank] == 4)
                    {
                        
tmpintrate tmpintrate/10;
                        
format(stringsizeof(string), "\nInterest rate: %d percent [Platinium VIP]",tmpintrate);
                        
strcat(mydialog,string);
                     }
                      else if(
PlayerInfo[i][pDonateRank] == 5)
                    {
                        
tmpintrate tmpintrate/10;
                        
format(stringsizeof(string), "\nInterest rate: %d percent [VIP Moderator]",tmpintrate);
                        
strcat(mydialog,string);
                     }
                    
format(stringsizeof(string), "\nInterest gained $%d"interest);
                    
strcat(mydialog,string);
                     
strcat(mydialog,"\n\n|------------------------------------------|");
                    
format(stringsizeof(string), "\n\nNew Balance: $%d"PlayerInfo[i][pAccount]);
                    
strcat(mydialog,string);
                    
ShowPlayerDialog(playeridDIALOG_IDDIALOG_STYLE_MSGBOX,"DIALOG TEXT",mydialog,"Okay",""); 
change the values in this to your values
Код:
ShowPlayerDialog(playerid, DIALOG_ID, DIALOG_STYLE_MSGBOX,"DIALOG TEXT",mydialog,"Okay","");



Re: Help me convert this to a Dialog? - ChildVape - 31.12.2017

What would go into the "Dialog text" ? Or is that like, a title?
because, essentially what I want to go into the dialog, is everything you just set. :P

Sorry btw. Still new to scripting. Trying to create a script on my own. It's hard.


Re: Help me convert this to a Dialog? - RogueDrifter - 31.12.2017

Quote:
Originally Posted by ChildVape
Посмотреть сообщение
What would go into the "Dialog text" ? Or is that like, a title?
because, essentially what I want to go into the dialog, is everything you just set. :P

Sorry btw. Still new to scripting. Trying to create a script on my own. It's hard.
DIALOG_ID is the id for the dialog (must be unique compared to any other dialog id to avoid conflict) which can be defined through #define DIALOG_ID 0 as an example or #define mydialogue 500 as another example, and dialog text is the title on top of the dialog which can be anything.


Re: Help me convert this to a Dialog? - Lucases - 31.12.2017

Create a big variable

pawn Код:
new statsstring[2500];
Then use a sequence of formats

pawn Код:
format(statsstring, sizeof(statsstring), "STATS ",params);
format(statsstring, sizeof(statsstring), " %s OTHER STATS", statsstring, other params);
format(statsstring, sizeof(statsstring), " %s OTHER STATS", statsstring, other params);
Don't use strcats


Re: Help me convert this to a Dialog? - RogueDrifter - 31.12.2017

Quote:
Originally Posted by Lucases
Посмотреть сообщение
Create a big variable

pawn Код:
new statsstring[2500];
Then use a sequence of formats

pawn Код:
format(statsstring, sizeof(statsstring), "STATS ",params);
format(statsstring, sizeof(statsstring), " %s OTHER STATS", statsstring, other params);
format(statsstring, sizeof(statsstring), " %s OTHER STATS", statsstring, other params);
Don't use strcats
Lmao, the most useless/meaningless post, 1- why use formats 2- why such a big array
Edit: the fact that you suggested making such a big array irrelevantly shows that you know 0 shit about what you just said as marking that array just takes up more memory, his post dialogue only takes up less than 400 characters, get out please.


Re: Help me convert this to a Dialog? - Lucases - 31.12.2017

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
Lmao, the most useless/meaningless post, 1- why use formats 2- why such a big array
Edit: the fact that you suggested making such a big array irrelevantly shows that you know 0 shit about what you just said as marking that array just takes up more memory, his post dialogue only takes up less than 400 characters, get out please.
Are you serious? I didn't check how many lines does hos stats take, as that was a general help.
You clearly know shit if you suggested to use thay sequence of strcats. You're just a REP hunter, I have noticed your posts everywhere. Check again my code and then post again.