SA-MP Forums Archive
Dialog problem - 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: Dialog problem (/showthread.php?tid=627058)



Dialog problem - Loinal - 23.01.2017

PHP код:
CMD:buyweapons(playerid,params[])
{
  new 
string[100+1000];
  
format(string,sizeof(string),"Deagle  Ammo: 100  Value: %d",Deagle);
  
format(string,sizeof(string),"Shotgun  Ammo: 200  Value: %d",Shotgun);
  
ShowPlayerDialog(playerid,100,DIALOG_STYLE_LIST,"Weapon system",string,"Select","Cancel");
  return 
1;

Only the Shotgun show not the both why?


Re: Dialog problem - Shaheen - 23.01.2017

PHP код:
CMD:buyweapons(playerid,params[]) 

  new 
string[400];//ur wish 
  
format(string,sizeof(string),"Deagle  Ammo: 100  Value: %d\nShotgun  Ammo: 200  Value: %d",Deagle,Shotgun); 
  
ShowPlayerDialog(playerid,100,DIALOG_STYLE_LIST,"Weapon system",string,"Select","Cancel"); 
  return 
1




Re: Dialog problem - saffierr - 23.01.2017

Why are you using
PHP код:
string[100+1000
?
And you should use the method give above.
"Weapon1\nWeapon2"


Re: Dialog problem - FaLLenGirL - 23.01.2017

Use this.

PHP код:
new eString9999 // put this at your variables
CMD:buyweaponsplayeridparams[ ] )
{
    
eString] = EOS;
    
formateStringsizeofeString ),"Deagle  Ammo: 100  Value: %d\n"Deagle );
    
formateStringsizeofeString ),"%sShotgun  Ammo: 200  Value: %d"eStringShotgun );
    
ShowPlayerDialogplayerid100DIALOG_STYLE_LIST"Weapon system"eString"Select" "Cancel" );
    return 
1;




Re: Dialog problem - Logic_ - 23.01.2017

@Shaheen and @FallenGirl, your codes can be optimized very heavily. You should never use format for copying strings and, something like weapon dialog can be done without doing the hard, long and time taking method.

@Loinal, You need to read AND UNDERSTAND about arrays and enumerators, and then try to make your code using them, You would be able to make your code in just a few lines. Also, it's better to use EasyDialogs by Emmet_.

P.S: I won't post the array version of the code just because this kid will copy it.


Re: Dialog problem - Loinal - 23.01.2017

Quote:
Originally Posted by Logic_
Посмотреть сообщение
@Shaheen and @FallenGirl, your codes can be optimized very heavily. You should never use format for copying strings and doing something like weapon dialog can be done without doing the hard, long and time taking method.

@Loinal, You need to read AND UNDERSTAND about arrays and enumerators, and then try to make your code using them, You would be able to make your code in just a few lines. Also, it's better to use EasyDialogs buy Emmet_.

P.S: I won't post the array version of the code just because this kid will copy it.
What do you mean by kid?


Re: Dialog problem - haikalbintang - 31.01.2017

You need strcat to show the Deagle & Shotgun :

PHP код:
CMD:buyweapons(playerid,params[]) 

  new 
string[256], tmp[256]; 
  
format(tmp,sizeof(tmp),"Deagle  Ammo: 100  Value: %d\n",Deagle); 
  
strcat(stringtmp);
  
format(tmp,sizeof(tmp),"Shotgun  Ammo: 200  Value: %d\n",Shotgun);
  
strcat(stringtmp);
  
ShowPlayerDialog(playerid,100,DIALOG_STYLE_LIST,"Weapon system",string,"Select","Cancel"); 
  return 
1

Try it, maybe it will working