Question 4: Strings inside of a list dialogue! -
TheTerminator - 06.01.2015
pawn Код:
CMD:inv(playerid, params[])
{
new string[200];
format(string, sizeof(string),"Ration: %d",PlayerInfo[playerid][pRation]);
ShowPlayerDialog(playerid, 6,DIALOG_STYLE_LIST,"Inventory",string,"OK","EXIT");
return 1;
}
There's a string in that dialogue, there where the contents of the list will be.
HOW DO I: Add another string, to the existing one so there's a list of 2!
For example:
When I go ingame, and type /inv
I get the box titled "Inventory" and it says; Ration: 0
I want it to say:
Ration: 0
Medkit: 0
etc..
So, how do I add another string to the existing one?
I want to add this as another string, what do I have to do?
Do I have to define a new string?
format(string, sizeof(string),"Medkit: %d",PlayerInfo[playerid][pMedkit]);
Re: Question 4: Strings inside of a list dialogue! -
Rufio - 06.01.2015
Put \n in between your lines.
Edit: like this;
pawn Код:
CMD:inv(playerid, params[])
{
new string[200];
format(string, sizeof(string),"Ration: %d\nYour extra thing here: %s",PlayerInfo[playerid][pRation],pName); // Just a poor example and won't work, just giving you the idea of it.
ShowPlayerDialog(playerid, 6,DIALOG_STYLE_LIST,"Inventory",string,"OK","EXIT");
return 1;
}
Re: Question 4: Strings inside of a list dialogue! -
TheTerminator - 06.01.2015
I tried, it didn't work!
@ Rufio!
EDIT: Will try now what you posted gonna reply asap
Shows:
Ration: 0
Medkit:
without the 0 or anything
Re: Question 4: Strings inside of a list dialogue! -
Rufio - 06.01.2015
Quote:
Originally Posted by TheTerminator
I tried, it didn't work!
@ Rufio!
EDIT: Will try now what you posted gonna reply asap
|
My example won't work, if that's what you mean. As I said, it was a poor example as if you haven't got "pName" variable scripted, it will give an error.
Re: Question 4: Strings inside of a list dialogue! -
TheTerminator - 06.01.2015
It worked, didn't give a number though, like, no numbers just Medkit:
NVM
I think the problem is I didn't add
PlayerInfo[playerid][pMedkit] to the script
Yeah now it worked
Re: Question 4: Strings inside of a list dialogue! -
Rufio - 06.01.2015
Quote:
Originally Posted by TheTerminator
It worked, didn't give a number though, like, no numbers just Medkit:
NVM
I think the problem is I didn't add
PlayerInfo[playerid][pMedkit] to the script
|
Exactly. Add it and don't forget to change my %s for %d, %s is a string variable whereas %d is an integer variable.
Edit: Glad it did! Feel free to reply if you have got any more questions or concerns.
Re: Question 4: Strings inside of a list dialogue! -
danish007 - 06.01.2015
didnt checked first reply.... removed!