// City Bank
int BankDist = ((int)Math.Sqrt(Math.Pow(Conn.CompCar.X - (-208 * 196608), 2) + Math.Pow(Conn.CompCar.Y - (-70 * 196608), 2)) / 65536);
if (BankDist < 10 && (Conn.CompCar.Speed / 147) <= 3)
{
if (Conn.InBank == 0)
{
// <<Bank Display>>
InSim.Send_BTN_CreateButton("", Flags.ButtonStyles.ISB_DARK, 50, 100, 50, 50, 160, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("", Flags.ButtonStyles.ISB_DARK, 50, 100, 50, 50, 161, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("^7Welcome to City ^6Bank", Flags.ButtonStyles.ISB_LIGHT, 7, 98, 51, 51, 162, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("^7Your bank balance is ^6€" + Conn.BankBalance, Flags.ButtonStyles.ISB_LEFT, 4, 40, 65, 54, 163, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("^7Time until Bonus ^6" + Conn.Timer + "^6 Minute(s)", Flags.ButtonStyles.ISB_LEFT, 4, 40, 69, 54, 164, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("^6Insert", "Enter amount to Insert", Flags.ButtonStyles.ISB_LIGHT | Flags.ButtonStyles.ISB_CLICK, 4, 10, 73, 54, 54, 165, Conn.UniqueID, 40, false);
InSim.Send_BTN_CreateButton("^6Withdraw", "Enter amount to Withdraw", Flags.ButtonStyles.ISB_LIGHT | Flags.ButtonStyles.ISB_CLICK, 4, 10, 73, 64, 64, 166, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("^7CLOSE", Flags.ButtonStyles.ISB_LIGHT | Flags.ButtonStyles.ISB_CLICK, 4, 10, 92, 95, 167, Conn.UniqueID, 2, false);
Conn.InBank = 1;
}
}
else if (BankDist > 14 && Conn.InBank == 1)
{
Conn.InBank = 0;
// <<Bank Display Removal>>
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 160, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 161, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 162, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 163, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 164, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 165, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 166, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 167, Conn.UniqueID);
}
// City Bank
int BankDist = ((int)Math.Sqrt(Math.Pow(Conn.CompCar.X - (296 * 196608), 2) + Math.Pow(Conn.CompCar.Y - (-331 * 196608), 2)) / 65536);
if (BankDist < 4 && (Conn.CompCar.Speed / 147) <= 3)
{
if (Conn.InBank == 0)
{
// <<Bank Display>>
InSim.Send_BTN_CreateButton("", Flags.ButtonStyles.ISB_DARK, 50, 100, 50, 50, 160, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("", Flags.ButtonStyles.ISB_DARK, 50, 100, 50, 50, 161, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("^7Welcome to City ^6Bank", Flags.ButtonStyles.ISB_LIGHT, 7, 98, 51, 51, 162, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("^7Your bank balance is ^6€" + Conn.BankBalance, Flags.ButtonStyles.ISB_LEFT, 4, 40, 65, 54, 163, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("^7Time until Bonus ^6" + Conn.Timer + "^6 Minute(s)", Flags.ButtonStyles.ISB_LEFT, 4, 40, 69, 54, 164, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("^6Insert", "Enter amount to Insert", Flags.ButtonStyles.ISB_LIGHT | Flags.ButtonStyles.ISB_CLICK, 4, 10, 73, 54, 54, 165, Conn.UniqueID, 40, false);
InSim.Send_BTN_CreateButton("^6Withdraw", "Enter amount to Withdraw", Flags.ButtonStyles.ISB_LIGHT | Flags.ButtonStyles.ISB_CLICK, 4, 10, 73, 64, 64, 166, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("^7CLOSE", Flags.ButtonStyles.ISB_LIGHT | Flags.ButtonStyles.ISB_CLICK, 4, 10, 92, 95, 167, Conn.UniqueID, 2, false);
Conn.InBank = 1;
}
}
else if (BankDist > 14 && Conn.InBank == 1)
{
Conn.InBank = 0;
// <<Bank Display Removal>>
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 160, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 161, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 162, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 163, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 164, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 165, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 166, Conn.UniqueID);
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_DEL_BTN, 167, Conn.UniqueID);
}
case "!settrap":
if (StrMsg.Length == 2)
{
if (Connections[GetConnIdx(MSO.UCID)].IsOfficerORCadet == 1)
{
try
{
if (Convert.ToInt32(StrMsg[1]) > 0)
{
Connections[GetConnIdx(MSO.UCID)].TrapSpeed = Convert.ToInt32(StrMsg[1]);
TrapUCID = MSO.UCID;
TrapSet = 1;
}
else
{
InSim.Send_MTC_MessageToConnection("^1Trap Error. Speed cannot be 0", MSO.UCID, 0);
}
}
catch
{
InSim.Send_MTC_MessageToConnection("^1Trap Error", MSO.UCID, 0);
}
}
}
if (StrMsg.Length == 1 && TrapSet == 0)
{
if (Connections[GetConnIdx(MSO.UCID)].TrapSpeed > 0)
{
Connections[GetConnIdx(MSO.UCID)].TrapSpeed = 0;
Connections[GetConnIdx(MSO.UCID)].TrapX = 0;
Connections[GetConnIdx(MSO.UCID)].TrapY = 0;
InSim.Send_MTC_MessageToConnection("^6>^1 Trap Removed", MSO.UCID, 0);
}
else
{
InSim.Send_MTC_MessageToConnection("^6>^7 Trap not yet set", MSO.UCID, 0);
}
}
if (StrMsg.Length > 2)
{
InSim.Send_MTC_MessageToConnection("^6>^7 Invalid command. Please see ^2!help^7 for a command list", MSO.UCID, 0);
}
break;
// When health < 1% we give Doctors bill
if (C.LastDistanceUpdate != C.TotalDistance)
{
if (C.PlayerName == "host")
{
}
else if (C.Health < 1)
{
InSim.Send_MST_Message("/msg " + C.PlayerName + "^7 paid €500 Doctors Clark!");
C.Health = 100;
C.Cash -= 500;
}
}