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;
}
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;
}
string[100+1000]
new eString[ 9999 ] // put this at your variables
CMD:buyweapons( playerid, params[ ] )
{
eString[ 0 ] = EOS;
format( eString, sizeof( eString ),"Deagle Ammo: 100 Value: %d\n", Deagle );
format( eString, sizeof( eString ),"%sShotgun Ammo: 200 Value: %d", eString, Shotgun );
ShowPlayerDialog( playerid, 100, DIALOG_STYLE_LIST, "Weapon system", eString, "Select" , "Cancel" );
return 1;
}
@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. |
CMD:buyweapons(playerid,params[])
{
new string[256], tmp[256];
format(tmp,sizeof(tmp),"Deagle Ammo: 100 Value: %d\n",Deagle);
strcat(string, tmp);
format(tmp,sizeof(tmp),"Shotgun Ammo: 200 Value: %d\n",Shotgun);
strcat(string, tmp);
ShowPlayerDialog(playerid,100,DIALOG_STYLE_LIST,"Weapon system",string,"Select","Cancel");
return 1;
}