// This is for adding places such as bank, lotto, etc.
^This is from the script what is use häm...............
i have made copy this code and edit the Positon who is in game hm..... why that not work ? can any help me pls ?
PS. (-49 * & (-99 * = line 1, and the new coordinates.
i must rename INT BankDistance = (Name alredy in use ??)
//
// Bank
//
int BankDistance1 = ((int)Math.Sqrt(Math.Pow(MCI.Info[i].X - (-49 * 196608), 2) + Math.Pow(MCI.Info[i].Y - (-99 * 196608), 2)) / 65536);
if (BankDistance <= 200)
{
if ((MCI.Info[i].Speed / 147) <= 3)
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].CampFineBank += 1;
if (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].CampFineBank == 6)
{
InSim.Send_MTC_MessageToConnection("^6| ^7Please move away from the bank, or you will be fined!", Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 0);
InSim.Send_MTC_MessageToConnection("^6| ^7You have 20 seconds to move.", Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 0);
}
if (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].CampFineBank == 46)
{
InSim.Send_MST_Message("/msg ^6|^3 " + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Username + " was fined €5 for camping!");
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].AddedBankTime += 600;
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Cash -= 5;
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].CampFineBank = 0;
}
}
}
else
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].CampFineBank = 0;
}
if (((MCI.Info[i].X / 196608) >= -190) && ((MCI.Info[i].X / 196608) <= -189) && ((MCI.Info[i].Y / 196608) >= -251) && ((MCI.Info[i].Y / 196608) <= -249) && ((MCI.Info[i].Speed / 147) <= 3) && (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsOfficerORCadet == 0))
{
if (OfficerOn == false)
{
if ((BankRobbable == false) && (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].AddedBankTime == 0) && (BankTimerCoolDown == 0))
{
if (BankChaseInProgress == 0)
{
for (byte b = 0; b < Players.Count; b++)
{
if (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[b].PLID)].UniqueID)].IsOfficerORCadet == 1)
{
if (BankChaseInProgress == 0)
{
switch (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].CurrentCar)
{
case "UF1":
TimerLength = 5;
break;
case "XFG":
TimerLength = 5;
break;
case "XRG":
TimerLength = 6;
break;
case "LX4":
TimerLength = 6;
break;
case "RAC":
TimerLength = 7;
break;
case "FXO":
TimerLength = 7;
break;
case "RB4":
TimerLength = 9;
break;
case "LX6":
TimerLength = 7;
break;
case "XRT":
TimerLength = 9;
break;
case "FZ5":
TimerLength = 9;
break;
case "UFR":
TimerLength = 10;
break;
case "XFR":
TimerLength = 10;
break;
case "FXR":
case "XRR":
case "FZR":
TimerLength = 12;
break;
case "MRT":
TimerLength = 7;
break;
case "FOX":
case "FBM":
case "FO8":
TimerLength = 12;
break;
case "BF1":
TimerLength = 15;
break;
}
BankCash = new Random().Next(2000, 7500);
InSim.Send_MST_Message("/msg ^6|^7 " + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].PlayerName + "^7 (" + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Username + ") robbed the bank");
InSim.Send_MST_Message("/msg ^6|^7 and stole ^1€" + BankCash + "^7!");
InSim.Send_MST_Message("/msg ^6|^7 Car: " + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].CurrentCar + " - Chase Timer: " + TimerLength);
BankChaseInProgress = 1;
RobberUCID = Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID;
BankTimer.Enabled = false;
}
}
foreach (clsConnection C in Connections)
{
if (C.IsOfficerORCadet == 1)
InSim.Send_MTC_MessageToConnection("^1BANK HAS BEEN ROBBED!!!", C.UniqueID, 0);
}
}
}
else if (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID != RobberUCID && Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsOfficerORCadet == 0 && Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInZone == 0)
{
InSim.Send_MTC_MessageToConnection("^1You cannot rob the bank while a robbery is in progress", Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 0);
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInZone = 1;
}
}
else if (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInZone == 0)
{
InSim.Send_MST_Message("/msg ^6|^7 " + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].PlayerName + "^7 (" + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Username + ") tried to rob the bank");
InSim.Send_MST_Message("/msg ^6|^3 but is too stupid to rob.");
InSim.Send_MTC_MessageToConnection("^1You have been spotted by the bank", Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 0);
InSim.Send_MTC_MessageToConnection("^1Please try again later", Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 0);
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].AddedBankTime += 600;
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInZone = 1;
}
}
else if (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInZone == 0)
{
InSim.Send_MTC_MessageToConnection("^1No officers on Duty this Time !", Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 0);
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInZone = 1;
}
}
^This is from the script what is use häm...............
i have made copy this code and edit the Positon who is in game hm..... why that not work ? can any help me pls ?
PS. (-49 * & (-99 * = line 1, and the new coordinates.
i must rename INT BankDistance = (Name alredy in use ??)
//
// Bank
//
int BankDistance1 = ((int)Math.Sqrt(Math.Pow(MCI.Info[i].X - (-49 * 196608), 2) + Math.Pow(MCI.Info[i].Y - (-99 * 196608), 2)) / 65536);
if (BankDistance <= 200)
{
if ((MCI.Info[i].Speed / 147) <= 3)
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].CampFineBank += 1;
if (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].CampFineBank == 6)
{
InSim.Send_MTC_MessageToConnection("^6| ^7Please move away from the bank, or you will be fined!", Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 0);
InSim.Send_MTC_MessageToConnection("^6| ^7You have 20 seconds to move.", Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 0);
}
if (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].CampFineBank == 46)
{
InSim.Send_MST_Message("/msg ^6|^3 " + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Username + " was fined €5 for camping!");
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].AddedBankTime += 600;
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Cash -= 5;
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].CampFineBank = 0;
}
}
}
else
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].CampFineBank = 0;
}
if (((MCI.Info[i].X / 196608) >= -190) && ((MCI.Info[i].X / 196608) <= -189) && ((MCI.Info[i].Y / 196608) >= -251) && ((MCI.Info[i].Y / 196608) <= -249) && ((MCI.Info[i].Speed / 147) <= 3) && (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsOfficerORCadet == 0))
{
if (OfficerOn == false)
{
if ((BankRobbable == false) && (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].AddedBankTime == 0) && (BankTimerCoolDown == 0))
{
if (BankChaseInProgress == 0)
{
for (byte b = 0; b < Players.Count; b++)
{
if (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[b].PLID)].UniqueID)].IsOfficerORCadet == 1)
{
if (BankChaseInProgress == 0)
{
switch (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].CurrentCar)
{
case "UF1":
TimerLength = 5;
break;
case "XFG":
TimerLength = 5;
break;
case "XRG":
TimerLength = 6;
break;
case "LX4":
TimerLength = 6;
break;
case "RAC":
TimerLength = 7;
break;
case "FXO":
TimerLength = 7;
break;
case "RB4":
TimerLength = 9;
break;
case "LX6":
TimerLength = 7;
break;
case "XRT":
TimerLength = 9;
break;
case "FZ5":
TimerLength = 9;
break;
case "UFR":
TimerLength = 10;
break;
case "XFR":
TimerLength = 10;
break;
case "FXR":
case "XRR":
case "FZR":
TimerLength = 12;
break;
case "MRT":
TimerLength = 7;
break;
case "FOX":
case "FBM":
case "FO8":
TimerLength = 12;
break;
case "BF1":
TimerLength = 15;
break;
}
BankCash = new Random().Next(2000, 7500);
InSim.Send_MST_Message("/msg ^6|^7 " + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].PlayerName + "^7 (" + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Username + ") robbed the bank");
InSim.Send_MST_Message("/msg ^6|^7 and stole ^1€" + BankCash + "^7!");
InSim.Send_MST_Message("/msg ^6|^7 Car: " + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].CurrentCar + " - Chase Timer: " + TimerLength);
BankChaseInProgress = 1;
RobberUCID = Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID;
BankTimer.Enabled = false;
}
}
foreach (clsConnection C in Connections)
{
if (C.IsOfficerORCadet == 1)
InSim.Send_MTC_MessageToConnection("^1BANK HAS BEEN ROBBED!!!", C.UniqueID, 0);
}
}
}
else if (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID != RobberUCID && Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsOfficerORCadet == 0 && Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInZone == 0)
{
InSim.Send_MTC_MessageToConnection("^1You cannot rob the bank while a robbery is in progress", Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 0);
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInZone = 1;
}
}
else if (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInZone == 0)
{
InSim.Send_MST_Message("/msg ^6|^7 " + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].PlayerName + "^7 (" + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Username + ") tried to rob the bank");
InSim.Send_MST_Message("/msg ^6|^3 but is too stupid to rob.");
InSim.Send_MTC_MessageToConnection("^1You have been spotted by the bank", Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 0);
InSim.Send_MTC_MessageToConnection("^1Please try again later", Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 0);
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].AddedBankTime += 600;
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInZone = 1;
}
}
else if (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInZone == 0)
{
InSim.Send_MTC_MessageToConnection("^1No officers on Duty this Time !", Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 0);
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInZone = 1;
}
}