Posts: 1,648
Threads: 482
Joined: Jun 2010
pawn Код:
else if(dialogid == DIALOG_FURNILIST)
{
if(response == 0)
{
return 1;
}
switch(listitem)
{
case 0:
{
DealerOrderFurniture(playerid, 2290, InfPrice(400), 0, 0);
}
case 1:
{
DealerOrderFurniture(playerid, 14490, InfPrice(200), 0, 0);
}
case 2:
{
DealerOrderFurniture(playerid, 1794, InfPrice(700), 0, 1);
}
case 3:
{
DealerOrderFurniture(playerid, 2247, InfPrice(60), 0, 0);
}
case 4:
{
DealerOrderFurniture(playerid, 2306, InfPrice(125), 1, 2);
}
case 5:
{
DealerOrderFurniture(playerid, 2073, InfPrice(100), 0, 0);
}
case 6:
{
DealerOrderFurniture(playerid, 1740, InfPrice(120), 1, 1);
}
case 7:
{
DealerOrderFurniture(playerid, 1734, InfPrice(130), 0, 0);
}
case 8:
{
DealerOrderFurniture(playerid, 2100, InfPrice(800), 0, 0);
}
case 9:
{
DealerOrderFurniture(playerid, 14527, InfPrice(80), 0, 0);
}
}
}
Title says all.
Pasting messed up the indentation.
Posts: 539
Threads: 30
Joined: Feb 2015
Reputation:
0
Nope, i don't think so.You could just SendClientMessage it and make commands to buy them...Like /buy1 = buy furnitures only...
Posts: 11,827
Threads: 33
Joined: Dec 2011
Reputation:
0
I'd use an array and "listitem" as its index.
Posts: 1,648
Threads: 482
Joined: Jun 2010
Quote:
Originally Posted by Konstantinos
I'd use an array and "listitem" as its index.
|
Ahh that's a pretty good idea actually.
But don't I still effectively have to add them all to the array?
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
Yes, but you can use the same array to generate the required dialog in the first place.
Posts: 1,648
Threads: 482
Joined: Jun 2010
I kind of understand,
Would it be like switch(FurniArray[listitem]]?
And then elsewhere like
FurniArray[0] = DealerOrderFurniture(....?
Posts: 1,648
Threads: 482
Joined: Jun 2010
For this will I also have to add 141 spaces to this:
pawn Код:
format(string, sizeof(string), "%s ($%s)\n%s ($%s)\n%s ($%s)\n%s ($%s)\n%s ($%s)\n%s ($%s)\n%s ($%s)\n%s ($%s)\n%s ($%s)\n%s ($%s)", GetFurniName(2290), AddCommas(InfPrice(400)),
GetFurniName(14490), AddCommas(InfPrice(200)), GetFurniName(1794), AddCommas(InfPrice(700)),GetFurniName(2247), AddCommas(InfPrice(60)), GetFurniName(2306), AddCommas(InfPrice(125)), GetFurniName(2073), AddCommas(InfPrice(100)), GetFurniName(1740), AddCommas(InfPrice(120)),GetFurniName(1734), AddCommas(InfPrice(130)), GetFurniName(2100), AddCommas(InfPrice(800)),GetFurniName(14527), AddCommas(InfPrice(80)));
Posts: 1,648
Threads: 482
Joined: Jun 2010
Ahhh you're a hero. Thank you very much!
EDIT:
How would I add that to my existing function as I need that!