Its about the electronics & furniture , Just like in LTC
The problem is that you can buy more than 10 items , because when you click the "buy" button you have to enter the amount you want to buy , and if you have already , lets say 9 items you can type 10 and have 19 items.
What I want to do is to make the buy button to buy only 1 item per click .
I just remove the "maximum buy ... " and the number 2 from 4, 10, 65, 100, 2, 118
And change the case 118
to
But when i click the buy button nothing seems to happen . Can someone tell me what I am doing wrong ?
I discovered that the number 2 in ButtonStyles.ISB_CLICK, 4, 10, 65, 100, 2, 118, Conn.UniqueID is the dialog that shows when i click buy but I didn't understand what exactly it represents , or if it leads to something else
The problem is that you can buy more than 10 items , because when you click the "buy" button you have to enter the amount you want to buy , and if you have already , lets say 9 items you can type 10 and have 19 items.
What I want to do is to make the buy button to buy only 1 item per click .
InSim.Send_BTN_CreateButton("^2Buy", "Maximum Buy 10 and you have " + Conn.Electronics, Flags.ButtonStyles.ISB_LIGHT | Flags.ButtonStyles.ISB_CLICK, 4, 10, 65, 100, 2, 118, Conn.UniqueID, 2, false);
I just remove the "maximum buy ... " and the number 2 from 4, 10, 65, 100, 2, 118
And change the case 118
case 118:
byte Electronics = byte.Parse(BTT.Text);
if (BTT.Text.Contains("-"))
{
MsgPly("^4)^7 Transaction Incorrect. Don't put minus on the values!", BTT.UCID);
}
else
{
if (Electronics > 10)
{
MsgPly("^4)^7 Cannot buy more than^2 10 Electronic Items!", BTT.UCID);
}
else
{
if (Conn.Electronics < 10)
{
if (Conn.Cash > 190 * Electronics)
{
Conn.Electronics += Electronics;
Conn.Cash -= 190 * Electronics;
Conn.TotalSale += Electronics;
MsgPly(Conn.PlayerName + "^7 bought some ^6Electronic^7 for ^2€" + Electronics * 190 + "^7!", BTT.UCID);
MsgPly("^1) Total Electronic: " + Conn.Electronics, BTT.UCID);
if (Conn.LastRaffle == 0)
{
MsgPly("^4)^7 Buy more items and more chances of winning in the ^1Raffle!", BTT.UCID);
if (Conn.DisplaysOpen == true && Conn.InStore == true && Conn.InGameIntrfc == 0)
{
InSim.Send_BTN_CreateButton("^7Total Item bought: ^2(" + Conn.TotalSale + ")^7 Raffle for ^1€300", Flags.ButtonStyles.ISB_LEFT, 4, 100, 73, 54, 116, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("^2Raffle!", Flags.ButtonStyles.ISB_LIGHT | Flags.ButtonStyles.ISB_CLICK, 4, 10, 73, 100, 120, Conn.UniqueID, 2, false);
}
}
if (Conn.DisplaysOpen == true && Conn.InStore == true && Conn.InGameIntrfc == 0)
{
InSim.Send_BTN_CreateButton("^2Buy", "Maximum Buy 10 and you have " + Conn.Electronics, Flags.ButtonStyles.ISB_LIGHT | Flags.ButtonStyles.ISB_CLICK, 4, 10, 65, 100, 2, 118, Conn.UniqueID, 2, false);
}
}
else
{
MsgPly("^4)^1 Not Enough Cash to complete the transaction.", BTT.UCID);
}
}
else
{
MsgPly("^4)^1 Cannot carry more than 10 items!", BTT.UCID);
}
}
}
to
#region ' Electronic '
case 118:
if (Conn.Electronics < 10)
{
if (Conn.Cash > 190)
{
Conn.Electronics += 1;
Conn.Cash -= 190;
Conn.TotalSale += 1;
MsgPly(Conn.PlayerName + "^7 bought some ^6Electronic^7!", BTT.UCID);
MsgPly("^1) Total Electronic: " + Conn.Electronics, BTT.UCID);
if (Conn.LastRaffle == 0)
{
MsgPly("^4)^7 Buy more items and more chances of winning in the ^1Raffle!", BTT.UCID);
if (Conn.DisplaysOpen == true && Conn.InStore == true && Conn.InGameIntrfc == 0)
{
InSim.Send_BTN_CreateButton("^7Total Item bought: ^2(" + Conn.TotalSale + ")^7 Raffle for ^1€300", Flags.ButtonStyles.ISB_LEFT, 4, 100, 73, 54, 116, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("^2Raffle!", Flags.ButtonStyles.ISB_LIGHT | Flags.ButtonStyles.ISB_CLICK, 4, 10, 73, 100, 120, Conn.UniqueID, 2, false);
}
}
if (Conn.DisplaysOpen == true && Conn.InStore == true && Conn.InGameIntrfc == 0)
{
InSim.Send_BTN_CreateButton("^2Buy", Flags.ButtonStyles.ISB_LIGHT | Flags.ButtonStyles.ISB_CLICK, 4, 10, 65, 100, 118, Conn.UniqueID, 2, false);
}
}
}
break;
#endregion
But when i click the buy button nothing seems to happen . Can someone tell me what I am doing wrong ?
I discovered that the number 2 in ButtonStyles.ISB_CLICK, 4, 10, 65, 100, 2, 118, Conn.UniqueID is the dialog that shows when i click buy but I didn't understand what exactly it represents , or if it leads to something else