Hello, i made an windows who open if player position is at
X-30
or
X-30
and
Y -19
or
Y -21
But the windows won't open!
Here is the code , where is the error ?
X-30
or
X-30
and
Y -19
or
Y -21
But the windows won't open!
Here is the code , where is the error ?
if (((MCI.Info[i].X / 196608) >= -31) && ((MCI.Info[i].X / 196608) <= -30) && ((MCI.Info[i].Y / 196608) >= -19) && ((MCI.Info[i].Y / 196608) <= -21) && ((MCI.Info[i].Speed / 147) <= 3))
{
if (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInWarehouse == 0 && Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInWarehouseOverride == 0)
{
InSim.Send_BTN_CreateButton("^7Stock:", Flags.ButtonStyles.ISB_LEFT | Flags.ButtonStyles.ISB_DARK, 7, 10, 50, 90, 200, Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 40, true);
InSim.Send_BTN_CreateButton("^7" + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].OwnedGoods, Flags.ButtonStyles.ISB_C1 | Flags.ButtonStyles.ISB_DARK, 7, 5, 50, 100, 201, Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 40, true);
InSim.Send_BTN_CreateButton("^2" + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].BuyingGoods, Flags.ButtonStyles.ISB_C1 | Flags.ButtonStyles.ISB_DARK, 7, 5, 50, 105, 202, Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 40, true);
InSim.Send_BTN_CreateButton("^7+", Flags.ButtonStyles.ISB_C1 | Flags.ButtonStyles.ISB_DARK | Flags.ButtonStyles.ISB_CLICK, 7, 5, 43, 105, 203, Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 40, true);
InSim.Send_BTN_CreateButton("^7-", Flags.ButtonStyles.ISB_C1 | Flags.ButtonStyles.ISB_DARK | Flags.ButtonStyles.ISB_CLICK, 7, 5, 57, 105, 204, Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 40, true);
InSim.Send_BTN_CreateButton("^7Cost: ^1€0", Flags.ButtonStyles.ISB_LEFT | Flags.ButtonStyles.ISB_DARK, 7, 12, 60, 90, 205, Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 40, true);
InSim.Send_BTN_CreateButton("^2Buy", Flags.ButtonStyles.ISB_LEFT | Flags.ButtonStyles.ISB_DARK | Flags.ButtonStyles.ISB_CLICK, 7, 7, 72, 90, 206, Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 40, true);
InSim.Send_BTN_CreateButton("^1Exit", Flags.ButtonStyles.ISB_LEFT | Flags.ButtonStyles.ISB_DARK | Flags.ButtonStyles.ISB_CLICK, 7, 7, 79, 90, 207, Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 40, true);
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInWarehouse = 1;
}
}
else
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInWarehouse = 0;
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInWarehouseOverride = 0;
}