private SqlDataReader LerColunas(SqlCommand cmdObj) { SqlDataReader rdObj = null; try { cmdObj.CommandText = "SELECT SC.column_id, SC.name, SC.max_length, SC.precision, " + Environment.NewLine + " CAST(SC.scale as smallint) as scale, " + Environment.NewLine + " RTRIM(TP.name) AS Tipo, SC.is_nullable, " + Environment.NewLine + " CAST(IC.key_ordinal as smallint) as key_ordinal " + Environment.NewLine + " FROM sys.columns SC " + Environment.NewLine + " JOIN sys.types TP " + Environment.NewLine + " ON TP.system_type_id = SC.system_type_id " + Environment.NewLine + " AND TP.user_type_id = SC.user_type_id " + Environment.NewLine + " LEFT JOIN sys.index_columns IC " + Environment.NewLine + " on IC.object_id = SC.object_id " + Environment.NewLine + " and IC.index_id = " + IdPKey.GetValueOrDefault().ToString() + Environment.NewLine + " and IC.column_id = SC.column_id " + Environment.NewLine + " where SC.object_id =" + IdObjeto.ToString() + Environment.NewLine + " order by SC.column_id "; rdObj = cmdObj.ExecuteReader(); while (rdObj.Read()) { ColDef Col = new ColDef(); Col.IdColuna = rdObj.GetInt32(0); Col.NomeCampo = rdObj.GetString(1); Col.Tamanho = rdObj.GetInt16(2); Col.Digitos = rdObj.GetInt16(4); Col.TipoCampo = rdObj.GetString(5); Col.PermNull = rdObj.GetBoolean(6); Col.IsOutParam = false; Col.PKey = null; if (!rdObj.IsDBNull(7)) { Col.PKey = rdObj.GetInt16(7); // key_ordinal começa em 1 } Col.Index = Cols.Count; Cols.Add(Col); // Guarda a coluna do PK if (Col.PKey.HasValue) { if (ColPKey == null) { ColPKey = Col; } PKCols++; } } } finally { rdObj.Close(); } return(rdObj); }
/// <summary> /// Creates the cols and caches the 2da's colhead data. /// </summary> /// <param name="rewidthOnly"><c>true</c> to only re-width cols - ie. /// Font changed</param> /// <seealso cref="CreateCol()"><c>CreateCol()</c></seealso> internal void CreateCols(bool rewidthOnly = false) { int c = 0; if (!rewidthOnly) { ColCount = Fields.Length + 1; // 'Fields' does not include rowhead or id-col for (; c != ColCount; ++c) { Cols.Add(new Col()); } Cols[0].text = gs.Id; // NOTE: Is not measured - the cells below it determine col-width. } int widthtext; c = 0; foreach (string head in Fields) // set initial col-widths based on colheads only -> { ++c; // start at col 1 - skip id col if (!rewidthOnly) { Cols[c].text = head; } widthtext = YataGraphics.MeasureWidth(head, _f.FontAccent); Cols[c]._widthtext = widthtext; Cols[c].width(widthtext + _padHori * 2 + _padHoriSort, rewidthOnly); } }
public void InsertReprojErrBlock(int obsIdx, int camIdx, int ptIdx, double[] J) { int n_new_cols = BA_NCAMPARAMS + 3 + 1; Rows.Add(Rows.Last() + n_new_cols); Rows.Add(Rows.Last() + n_new_cols); for (int i_row = 0; i_row < 2; i_row++) { for (int i = 0; i < BA_NCAMPARAMS; i++) { Cols.Add(BA_NCAMPARAMS * camIdx + i); Vals.Add(J[2 * i + i_row]); } int col_offset = BA_NCAMPARAMS * N; int val_offset = BA_NCAMPARAMS * 2; for (int i = 0; i < 3; i++) { Cols.Add(col_offset + 3 * ptIdx + i); Vals.Add(J[val_offset + 2 * i + i_row]); } col_offset += 3 * M; val_offset += 3 * 2; Cols.Add(col_offset + obsIdx); Vals.Add(J[val_offset + i_row]); } }
public void onResourceStart() { try { NAPI.TextLabel.CreateTextLabel("~g~Benson Pain", new Vector3(-2347.958, 3268.936, 33.81076), 5f, 0.3f, 0, new Color(255, 255, 255), true, NAPI.GlobalDimension); Cols.Add(0, NAPI.ColShape.CreateCylinderColShape(ArmyCheckpoints[0], 1, 2, 0)); Cols[0].SetData("INTERACT", 34); Cols[0].OnEntityEnterColShape += onEntityEnterColshape; Cols[0].OnEntityExitColShape += onEntityExitColshape; NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Нажмите E, что-бы открыть gun меню."), new Vector3(ArmyCheckpoints[0].X, ArmyCheckpoints[0].Y, ArmyCheckpoints[0].Z + 1), 5F, 0.3F, 0, new Color(255, 255, 255)); Cols.Add(1, NAPI.ColShape.CreateCylinderColShape(ArmyCheckpoints[1], 1, 2, 0)); Cols[1].SetData("INTERACT", 35); Cols[1].OnEntityEnterColShape += onEntityEnterColshape; Cols[1].OnEntityExitColShape += onEntityExitColshape; NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Нажмите E, что-бы переодеться."), new Vector3(ArmyCheckpoints[1].X, ArmyCheckpoints[1].Y, ArmyCheckpoints[1].Z + 1), 5F, 0.3F, 0, new Color(255, 255, 255)); Cols.Add(2, NAPI.ColShape.CreateCylinderColShape(ArmyCheckpoints[2], 5, 6, 0)); Cols[2].SetData("INTERACT", 36); Cols[2].OnEntityEnterColShape += onEntityEnterColshape; Cols[2].OnEntityExitColShape += onEntityExitArmyMats; Cols.Add(3, NAPI.ColShape.CreateCylinderColShape(ArmyCheckpoints[3], 1, 2, 0)); Cols[3].SetData("INTERACT", 25); Cols[3].OnEntityEnterColShape += onEntityEnterColshape; Cols[3].OnEntityExitColShape += onEntityExitColshape; NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Лифт на вышку."), new Vector3(ArmyCheckpoints[3].X, ArmyCheckpoints[3].Y, ArmyCheckpoints[3].Z + 1), 5F, 0.3F, 0, new Color(255, 255, 255)); Cols.Add(4, NAPI.ColShape.CreateCylinderColShape(ArmyCheckpoints[4], 1, 2, 0)); Cols[4].SetData("INTERACT", 25); Cols[4].OnEntityEnterColShape += onEntityEnterColshape; Cols[4].OnEntityExitColShape += onEntityExitColshape; NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Лифт на 1 этаж."), new Vector3(ArmyCheckpoints[4].X, ArmyCheckpoints[4].Y, ArmyCheckpoints[4].Z + 1), 5F, 0.3F, 0, new Color(255, 255, 255)); Cols.Add(5, NAPI.ColShape.CreateCylinderColShape(ArmyCheckpoints[5], 1, 2, 0)); Cols[5].SetData("INTERACT", 60); Cols[5].OnEntityEnterColShape += onEntityEnterColshape; Cols[5].OnEntityExitColShape += onEntityExitColshape; NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Открыть склад Оружий."), new Vector3(ArmyCheckpoints[5].X, ArmyCheckpoints[5].Y, ArmyCheckpoints[5].Z + 1), 5F, 0.3F, 0, new Color(255, 255, 255)); NAPI.Marker.CreateMarker(1, ArmyCheckpoints[0] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); NAPI.Marker.CreateMarker(1, ArmyCheckpoints[1] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); NAPI.Marker.CreateMarker(1, ArmyCheckpoints[2], new Vector3(), new Vector3(), 5f, new Color(155, 0, 0)); NAPI.Marker.CreateMarker(1, ArmyCheckpoints[3] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); NAPI.Marker.CreateMarker(1, ArmyCheckpoints[4] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); NAPI.Marker.CreateMarker(1, ArmyCheckpoints[5] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); Cols.Add(6, NAPI.ColShape.CreateCylinderColShape(ArmyCheckpoints[6], 1, 2, 0)); Cols[6].SetData("INTERACT", 34); Cols[6].OnEntityEnterColShape += onEntityEnterColshape; Cols[6].OnEntityExitColShape += onEntityExitColshape; NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~,Вход в кадетский корпус."), new Vector3(ArmyCheckpoints[6].X, ArmyCheckpoints[6].Y, ArmyCheckpoints[6].Z + 1), 5F, 0.3F, 0, new Color(255, 255, 255)); } catch (Exception e) { Log.Write("ResourceStart: " + e.Message, nLog.Type.Error); } }
/// <summary> /// 使用DataTable来填充 /// </summary> /// <param name="dt"></param> public void FillBy(DataTable dt) { Cols.Clear(); Rows.Clear(); var regCardNum = new Regex(msRegCardNum, RegexOptions.IgnoreCase); var bInitCols = true; foreach (DataRow dataRow in dt.Rows) { var row = new RowType(); foreach (DataColumn dataColumn in dt.Columns) { var sCol = dataColumn.ColumnName; if (!CheckValid(sCol)) { continue; } var sCell = dataRow[sCol].ToString(); if (regCardNum.IsMatch(sCol)) { //chage to base64 string var sTemp = MyCrypt.Encode(sCell, 0x21); //简单加一加密码 byte[] bytes = Encoding.ASCII.GetBytes(sTemp ?? string.Empty); string sBase64 = Convert.ToBase64String(bytes); sCell = sBase64; } if (bInitCols) { Cols.Add(sCol); } row.Add(sCell); } bInitCols = false; Rows.Add(row); } //没有记录集的话,也要输出列名 if (0 == dt.Rows.Count) { foreach (DataColumn dataColumn in dt.Columns) { var sCol = dataColumn.ColumnName; if (!CheckValid(sCol)) { continue; } Cols.Add(sCol); } } }
public void onResourceStart() { try { NAPI.TextLabel.CreateTextLabel("~g~Benson Pain", new Vector3(-2347.958, 3268.936, 33.81076), 5f, 0.3f, 0, new Color(255, 255, 255), true, NAPI.GlobalDimension); Cols.Add(0, NAPI.ColShape.CreateCylinderColShape(ArmyCheckpoints[0], 1, 2, 0)); Cols[0].SetData("INTERACT", 34); Cols[0].OnEntityEnterColShape += onEntityEnterColshape; Cols[0].OnEntityExitColShape += onEntityExitColshape; NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Press E, to open gun menu"), new Vector3(ArmyCheckpoints[0].X, ArmyCheckpoints[0].Y, ArmyCheckpoints[0].Z + 1), 5F, 0.3F, 0, new Color(255, 255, 255)); Cols.Add(1, NAPI.ColShape.CreateCylinderColShape(ArmyCheckpoints[1], 1, 2, 0)); Cols[1].SetData("INTERACT", 35); Cols[1].OnEntityEnterColShape += onEntityEnterColshape; Cols[1].OnEntityExitColShape += onEntityExitColshape; NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Press E, to change clothes"), new Vector3(ArmyCheckpoints[1].X, ArmyCheckpoints[1].Y, ArmyCheckpoints[1].Z + 1), 5F, 0.3F, 0, new Color(255, 255, 255)); Cols.Add(2, NAPI.ColShape.CreateCylinderColShape(ArmyCheckpoints[2], 5, 6, 0)); Cols[2].SetData("INTERACT", 36); Cols[2].OnEntityEnterColShape += onEntityEnterColshape; Cols[2].OnEntityExitColShape += onEntityExitArmyMats; Cols.Add(3, NAPI.ColShape.CreateCylinderColShape(ArmyCheckpoints[3], 1, 2, 0)); Cols[3].SetData("INTERACT", 25); Cols[3].OnEntityEnterColShape += onEntityEnterColshape; Cols[3].OnEntityExitColShape += onEntityExitColshape; NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Lift"), new Vector3(ArmyCheckpoints[3].X, ArmyCheckpoints[3].Y, ArmyCheckpoints[3].Z + 1), 5F, 0.3F, 0, new Color(255, 255, 255)); Cols.Add(4, NAPI.ColShape.CreateCylinderColShape(ArmyCheckpoints[4], 1, 2, 0)); Cols[4].SetData("INTERACT", 25); Cols[4].OnEntityEnterColShape += onEntityEnterColshape; Cols[4].OnEntityExitColShape += onEntityExitColshape; NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Lift"), new Vector3(ArmyCheckpoints[4].X, ArmyCheckpoints[4].Y, ArmyCheckpoints[4].Z + 1), 5F, 0.3F, 0, new Color(255, 255, 255)); Cols.Add(5, NAPI.ColShape.CreateCylinderColShape(ArmyCheckpoints[5], 1, 2, 0)); Cols[5].SetData("INTERACT", 60); Cols[5].OnEntityEnterColShape += onEntityEnterColshape; Cols[5].OnEntityExitColShape += onEntityExitColshape; NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Open gun stock"), new Vector3(ArmyCheckpoints[5].X, ArmyCheckpoints[5].Y, ArmyCheckpoints[5].Z + 1), 5F, 0.3F, 0, new Color(255, 255, 255)); NAPI.Marker.CreateMarker(1, ArmyCheckpoints[0] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); NAPI.Marker.CreateMarker(1, ArmyCheckpoints[1] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); NAPI.Marker.CreateMarker(1, ArmyCheckpoints[2], new Vector3(), new Vector3(), 5f, new Color(155, 0, 0)); NAPI.Marker.CreateMarker(1, ArmyCheckpoints[3] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); NAPI.Marker.CreateMarker(1, ArmyCheckpoints[4] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); NAPI.Marker.CreateMarker(1, ArmyCheckpoints[5] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); } catch (Exception e) { Log.Write("ResourceStart: " + e.Message, nLog.Type.Error); } }
/// <summary> /// 水平分页 /// </summary> /// <param name="p_colPage"></param> /// <param name="p_leftWidth"></param> /// <param name="p_inItem"></param> void HorPageBreak(ref PageDefine p_colPage, ref double p_leftWidth, bool p_inItem = true) { //上页结束 if (p_inItem && HorPageEnd != null) { _pageEnding = true; HorPageEnd(this, p_colPage); _pageEnding = false; } PageDefine next = new PageDefine(); next.Start = p_colPage.Start + p_colPage.Count; Cols.Add(next); p_leftWidth = 0; p_colPage = next; }
public void onResourceStart() { try { Cols.Add(0, NAPI.ColShape.CreateCylinderColShape(Coords[0], 1, 2, 0)); // start work Cols[0].OnEntityEnterColShape += gp_onEntityEnterColShape; Cols[0].OnEntityExitColShape += gp_onEntityExitColShape; Cols[0].SetData("INTERACT", 28); NAPI.TextLabel.CreateTextLabel(Main.StringToU16("Postal stock"), Coords[0] + new Vector3(0, 0, 0.3), 10F, 0.6F, 0, new Color(0, 180, 0)); Cols.Add(1, NAPI.ColShape.CreateCylinderColShape(Coords[1], 1, 2, 0)); // get car Cols[1].OnEntityEnterColShape += gp_onEntityEnterColShape; Cols[1].OnEntityExitColShape += gp_onEntityExitColShape; Cols[1].SetData("INTERACT", 29); NAPI.TextLabel.CreateTextLabel(Main.StringToU16("Take work car"), Coords[1] + new Vector3(0, 0, 0.3), 10F, 0.6F, 0, new Color(0, 180, 0)); } catch (Exception e) { Log.Write("ResourceStart: " + e.Message, nLog.Type.Error); } }
public MessageTable(SourceTypeMessages ms) : base() { P = ms; ShouldHighlight = o => !((MessageRef)o).IsRead; IsSelected = o => ((MessageRef)o).Id == P._activeItemId; DisCol = new Col { Title = "DIS", Print = o => { var m = (MessageRef)o; var s = m.GetSource(P.QuerySources); if (s == null) { return(""); } else { return(s.GetShortDistinguisher()); } }, MaxWidth = 132, Hidden = true }; Cols.Add(DisCol); Cols.Add(FromCol); Cols.Add(new Col { Title = "SUBJECT", Stretches = true, Print = o => { var m = (MessageRef)o; return(m.GetTextSummary()); } }); Cols.Add(new Col { Title = "DATE", Stretches = false, Print = o => { var m = (MessageRef)o; return(Theme.FormatTime(m.PublishTime.ToLocalTime())); } }); ShouldHighlight = o => { var m = (MessageRef)o; return(!m.IsRead); }; }
public void onResourceStart() { try { Cols.Add(0, NAPI.ColShape.CreateCylinderColShape(Points[0], 1, 2, 0)); // job placement Cols[0].OnEntityEnterColShape += JobMenu_onEntityEnterColShape; // job placement point handler NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Устройство на Работы."), new Vector3(Points[0].X, Points[0].Y, Points[0].Z + 0.5), 10F, 0.3F, 0, new Color(255, 255, 255)); NAPI.Marker.CreateMarker(1, Points[0] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); // Не работает СТОИТ ИЗМЕНЯТЬ // blips NAPI.Blip.CreateBlip(354, new Vector3(724.9625, 133.9959, 79.83643), 1.5f, 46, Main.StringToU16("Power Station"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(408, new Vector3(105.4633, -1568.843, 28.60269), 1, 3, Main.StringToU16("Postal"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(198, new Vector3(903.3215, -191.7, 73.40494), 1, 46, Main.StringToU16("Taxi"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(198, new Vector3(1956.65015, 3769.12817, 31.0833454), 1, 46, Main.StringToU16("Taxi"), 255, 0, true, 0, 0);//TODOTAXI NAPI.Blip.CreateBlip(198, new Vector3(1791.82837, 4586.595, 36.2361145), 1, 46, Main.StringToU16("Taxi"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(513, new Vector3(462.6476, -605.5295, 27.49518), 1, 30, Main.StringToU16("Bus"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(512, new Vector3(-1331.475, 53.58579, 53.53268), 1, 2, Main.StringToU16("Lanwmower"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(477, new Vector3(588.2037, -3037.641, 6.303829), 1, 4, Main.StringToU16("Trucker"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(477, new Vector3(338.9279, 3417.426, 35.38838), 1, 4, Main.StringToU16("Trucker"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(477, new Vector3(-2212.77, 4249.193, 46.17959), 1, 4, Main.StringToU16("Trucker"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(67, new Vector3(915.9069, -1265.255, 25.52912), 1, 63, Main.StringToU16("Collector"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(67, new Vector3(-1481.75537, -508.08847, 31.6868382), 1, 63, Main.StringToU16("Collector"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(67, new Vector3(-144.374817, 6354.90869, 30.3706112), 1, 63, Main.StringToU16("Collector"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(446, new Vector3(473.9508, -1275.597, 29.60513), 1, 40, Main.StringToU16("Auto Mechanic"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(225, new Vector3(-501.78833, 61.4290543, 56.57218), 1, 33, Main.StringToU16("Rent-a-Car"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(495, new Vector3(-1108.662, -1690.129, 3.254202), 1, 84, Main.StringToU16("Rent-a-Cycle"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(471, new Vector3(-1625.545, -1164.137, 0.2994334), 1, 38, Main.StringToU16("Rent-a-Boat"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(80, Truckers.getProduct[0], 1, 84, Main.StringToU16("Products stock"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(80, Truckers.getProduct[1], 1, 36, Main.StringToU16("Fuel stock"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(80, Truckers.getProduct[2], 1, 15, Main.StringToU16("Auto stock"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(80, Truckers.getProduct[3], 1, 62, Main.StringToU16("Guns stock"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(603, new Vector3(-2350.931, 3270.689, 40.95937), 1, 31, Main.StringToU16("Army"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(181, new Vector3(-2397.011, -1777.352, 8.353774), 1, 46, Main.StringToU16("Dubai"), 255, 0, true, 0, 0); // markers NAPI.Marker.CreateMarker(1, new Vector3(105.4633, -1568.843, 28.60269) - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); // new Vector3(105.4633, -1568.843, 28.60269) NAPI.Marker.CreateMarker(1, new Vector3(106.2007, -1563.748, 28.60272) - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); // new Vector3(106.2007, -1563.748, 28.60272) NAPI.Marker.CreateMarker(1, new Vector3(-0.51, -436.71, 38.74) - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); // new Vector3(-0.51, -436.71, 38.74) } catch (Exception e) { Log.Write("ResourceStart: " + e.Message, nLog.Type.Error); } }
private SqlDataReader LerParametros(SqlCommand cmdObj) { SqlDataReader rdObj = null; try { cmdObj.CommandText = "SELECT P.parameter_id, P.name, P.max_length, P.precision, " + Environment.NewLine + " CAST(P.scale as smallint) as scale, " + Environment.NewLine + " RTRIM(TP.name) AS Tipo, P.is_output " + Environment.NewLine + " FROM sys.parameters P " + Environment.NewLine + " JOIN sys.types TP " + Environment.NewLine + " ON TP.system_type_id = P.system_type_id " + Environment.NewLine + " AND TP.user_type_id = P.user_type_id " + Environment.NewLine + " where P.object_id =" + IdObjeto.ToString() + Environment.NewLine + " order by P.parameter_id "; rdObj = cmdObj.ExecuteReader(); while (rdObj.Read()) { ColDef Col = new ColDef(); Col.IdColuna = rdObj.GetInt32(0); String NomeCampo = rdObj.GetString(1); Col.NomeCampo = NomeCampo.Replace("@", String.Empty); Col.Tamanho = rdObj.GetInt16(2); Col.Digitos = rdObj.GetInt16(4); Col.TipoCampo = rdObj.GetString(5); Col.PermNull = true; Col.IsOutParam = rdObj.GetBoolean(6); Col.PKey = null; Col.Index = Cols.Count; Cols.Add(Col); } } finally { rdObj.Close(); } return(rdObj); }
public void InsertWErrBlock(int wIdx, double w_d) { Rows.Add(Rows.Last() + 1); Cols.Add(BA_NCAMPARAMS * N + 3 * M + wIdx); Vals.Add(w_d); }
public ColumnListModel() { Cols.Add <_Int32>(); Cols.Add(SimpleModel._Column1, true); }
public static string Json(DataSet ds, int total, int page, int rows, List <string> Cols, List <string> SumCols) { int num = 1; int num2 = 0; int count = ds.Tables[0].Rows.Count; int num4 = 0; int num5 = ds.Tables[0].Columns.Count; Dictionary <string, double> dictionary = new Dictionary <string, double>(); string str = ""; StringBuilder builder = new StringBuilder(); if (Cols == null) { Cols = new List <string>(); } if (SumCols == null) { SumCols = new List <string>(); } if (Cols.Count == 0) { for (int i = 0; i < num5; i++) { Cols.Add(ds.Tables[0].Columns[i].ColumnName); } } foreach (string str2 in SumCols) { dictionary.Add(str2, 0.0); } builder.Append("{"); builder.Append("\"total\":"); builder.Append("\"" + total.ToString() + "\""); builder.Append(",\"page\":"); builder.Append("\"" + page.ToString() + "\""); builder.Append(",\"records\":"); builder.Append("\"" + ds.Tables[0].Rows.Count.ToString() + "\""); builder.Append(",\"rows\":["); for (num2 = (page - 1) * rows; (num2 < count) && (num4 < rows); num2++) { DataRow row = ds.Tables[0].Rows[num2]; if (num4 > 0) { builder.Append(","); } builder.Append("{"); try { str = DataFormatter.Format(row["ID"]); } catch (Exception) { str = num.ToString(); num++; } builder.Append("\"id\":\"" + str + "\","); builder.Append("\"cell\":["); bool flag = true; foreach (string str3 in Cols) { if (!flag) { builder.Append(","); } builder.Append("\"" + DataFormatter.Format(row[str3]) + "\""); flag = false; try { Dictionary <string, double> dictionary2; string str5; (dictionary2 = dictionary)[str5 = str3] = dictionary2[str5] + row[str3].TryToDouble(); } catch (Exception) { if (dictionary.ContainsKey(str3)) { dictionary.Remove(str3); } } } builder.Append("]"); builder.Append("}"); num4++; } builder.Append("]"); builder.Append(",\"userdata\":{"); bool flag2 = true; foreach (string str4 in dictionary.Keys) { if (!flag2) { builder.Append(","); } builder.Append("\"" + str4 + "\":"); builder.Append("\"" + DataFormatter.Format(dictionary[str4]) + "\""); flag2 = false; } builder.Append("}"); builder.Append("}"); return(builder.ToString()); }
public void onResourceStart() { try { Cols.Add(0, NAPI.ColShape.CreateCylinderColShape(Points[0], 1, 2, 0)); // job placement Cols[0].OnEntityEnterColShape += JobMenu_onEntityEnterColShape; // job placement point handler NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Работа"), new Vector3(Points[0].X, Points[0].Y, Points[0].Z + 0.5), 10F, 0.3F, 0, new Color(255, 255, 255)); NAPI.Marker.CreateMarker(1, Points[0] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); //FractionManager - костыль NAPI.Blip.CreateBlip(589, new Vector3(1571.831, 2240.648, 78.40011), 1.3f, 75, Main.StringToU16("Merryweather Security"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(494, FractionSpawns[16], 1, 20, Main.StringToU16("Байкеры The Lost"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(590, new Vector3(-1072.655, -246.5676, 53.506), 1, 45, Main.StringToU16("Новости"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(419, new Vector3(-545.0524, -204.0801, 37.09514), 1.5f, 14, Main.StringToU16("Мэрия"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(61, new Vector3(-448.1993, -340.8513, 33.3818), 1, 49, Main.StringToU16("Больница"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(88, new Vector3(-1581.552, -557.9453, 33.83302), 1, 58, Main.StringToU16("ФБР"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(526, new Vector3(452.4479, -980.1406, 29.68958), 1, 38, Main.StringToU16("Полиция"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(85, new Vector3(-108.0619, -2414.873, 5.000001), 1, 28, Main.StringToU16("Армия"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(84, FractionSpawns[1], 1, 52, Main.StringToU16("The Families"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(84, FractionSpawns[2], 1, 58, Main.StringToU16("The Ballas"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(84, FractionSpawns[3], 1, 28, Main.StringToU16("Los Santos Vagos"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(84, FractionSpawns[4], 1, 74, Main.StringToU16("Marabunta Grande"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(84, FractionSpawns[5], 1, 49, Main.StringToU16("Кровавые"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(78, FractionSpawns[10], 1, 5, Main.StringToU16("Итальянская мафия"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(78, FractionSpawns[11], 1, 4, Main.StringToU16("Русская мафия"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(78, FractionSpawns[12], 1, 76, Main.StringToU16("Якудза"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(78, FractionSpawns[13], 1, 40, Main.StringToU16("Армянская мафия"), 255, 0, true, 0, 0); // blips NAPI.Blip.CreateBlip(354, new Vector3(724.9625, 133.9959, 79.83643), 1.5f, 46, Main.StringToU16("Подстанция"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(408, new Vector3(105.4633, -1568.843, 28.60269), 1, 3, Main.StringToU16("Почта"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(198, new Vector3(903.3215, -191.7, 73.40494), 1, 46, Main.StringToU16("Такси"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(198, new Vector3(1956.65015, 3769.12817, 31.0833454), 1, 46, Main.StringToU16("Такси"), 255, 0, true, 0, 0);//TODOTAXI NAPI.Blip.CreateBlip(198, new Vector3(1791.82837, 4586.595, 36.2361145), 1, 46, Main.StringToU16("Такси"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(513, new Vector3(462.6476, -605.5295, 27.49518), 1, 30, Main.StringToU16("Автобусы"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(512, new Vector3(-1331.475, 53.58579, 53.53268), 1, 2, Main.StringToU16("Lanwmower"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(477, new Vector3(588.2037, -3037.641, 6.303829), 1, 4, Main.StringToU16("Грузовик"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(477, new Vector3(338.9279, 3417.426, 35.38838), 1, 4, Main.StringToU16("Грузовик"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(477, new Vector3(-2212.77, 4249.193, 46.17959), 1, 4, Main.StringToU16("Грузовик"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(67, new Vector3(915.9069, -1265.255, 25.52912), 1, 63, Main.StringToU16("Коллектор"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(67, new Vector3(-1481.75537, -508.08847, 31.6868382), 1, 63, Main.StringToU16("Коллектор"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(67, new Vector3(-144.374817, 6354.90869, 30.3706112), 1, 63, Main.StringToU16("Коллектор"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(446, new Vector3(473.9508, -1275.597, 29.60513), 1, 40, Main.StringToU16("АвтоМеханик"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(225, new Vector3(-501.78833, 61.4290543, 56.57218), 1, 33, Main.StringToU16("Машина в аренду"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(495, new Vector3(-1108.662, -1690.129, 3.254202), 1, 84, Main.StringToU16("Велосипед в аренду"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(471, new Vector3(-1625.545, -1164.137, 0.2994334), 1, 38, Main.StringToU16("Катер в аренду"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(80, Truckers.getProduct[0], 1, 84, Main.StringToU16("Products stock"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(80, Truckers.getProduct[1], 1, 36, Main.StringToU16("Fuel stock"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(80, Truckers.getProduct[2], 1, 15, Main.StringToU16("Auto stock"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(80, Truckers.getProduct[3], 1, 62, Main.StringToU16("Guns stock"), 255, 0, true, 0, 0); // markers NAPI.Marker.CreateMarker(1, new Vector3(105.4633, -1568.843, 28.60269) - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); NAPI.Marker.CreateMarker(1, new Vector3(106.2007, -1563.748, 28.60272) - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); NAPI.Marker.CreateMarker(1, new Vector3(-0.51, -436.71, 38.74) - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); } catch (Exception e) { Log.Write("ResourceStart: " + e.Message, nLog.Type.Error); } }
public void onResourceStartHandler() { try { NAPI.TextLabel.CreateTextLabel("~g~Tom Logan", new Vector3(253.9357, 228.9332, 102.6832), 5f, 0.3f, 0, new Color(255, 255, 255), true, NAPI.GlobalDimension); NAPI.TextLabel.CreateTextLabel("~g~Lorens Hope", new Vector3(262.7953, 220.5285, 102.6832), 5f, 0.3f, 0, new Color(255, 255, 255), true, NAPI.GlobalDimension); Cols.Add(0, NAPI.ColShape.CreateCylinderColShape(CityhallCheckpoints[0], 1f, 2, 0)); // Оружейка Cols[0].OnEntityEnterColShape += city_OnEntityEnterColShape; Cols[0].OnEntityExitColShape += city_OnEntityExitColShape; Cols[0].SetData("INTERACT", 9); NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Открыть шкафчик"), new Vector3(CityhallCheckpoints[0].X, CityhallCheckpoints[0].Y, CityhallCheckpoints[0].Z + 0.7), 5F, 0.4F, 0, new Color(255, 255, 255)); Cols.Add(1, NAPI.ColShape.CreateCylinderColShape(CityhallCheckpoints[1], 1f, 2, 0)); // Раздевалка Cols[1].OnEntityEnterColShape += city_OnEntityEnterColShape; Cols[1].OnEntityExitColShape += city_OnEntityExitColShape; Cols[1].SetData("INTERACT", 1); NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Раздевалка"), CityhallCheckpoints[1] + new Vector3(0, 0, 0.7), 5F, 0.4F, 0, new Color(255, 255, 255)); for (int i = 2; i < 4; i++) { Cols.Add(i, NAPI.ColShape.CreateCylinderColShape(CityhallCheckpoints[i], 1, 2, 0)); Cols[i].OnEntityEnterColShape += city_OnEntityEnterColShape; Cols[i].OnEntityExitColShape += city_OnEntityExitColShape; Cols[i].SetData("INTERACT", 5); NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Press E"), new Vector3(CityhallCheckpoints[i].X, CityhallCheckpoints[i].Y, CityhallCheckpoints[i].Z + 1), 5F, 0.3F, 0, new Color(255, 255, 255)); NAPI.Marker.CreateMarker(21, CityhallCheckpoints[i] + new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 0.8f, new Color(255, 255, 255, 60)); } /*int door = 0; * for (int i = 4; i < 6; i++) * { * Cols.Add(i, NAPI.ColShape.CreateCylinderColShape(CityhallChecksCoords[i], 1, 2, 0)); * Cols[i].OnEntityEnterColShape += city_OnEntityEnterColShape; * Cols[i].OnEntityExitColShape += city_OnEntityExitColShape; * Cols[i].SetData("INTERACT", 3); * Cols[i].SetData("DOOR", door); * door++; * }*/ /* Cols.Add(12, NAPI.ColShape.CreateCylinderColShape(new Vector3(255.2283, 223.976, 102.3932), 3, 2, 0)); * Cols[12].OnEntityEnterColShape += city_OnEntityEnterColShape; * Cols[12].OnEntityExitColShape += city_OnEntityExitColShape; * Cols[12].SetData("INTERACT", 4);*/ NAPI.Marker.CreateMarker(1, CityhallCheckpoints[0] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1, new Color(255, 255, 255, 220)); NAPI.Marker.CreateMarker(1, CityhallCheckpoints[1] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1, new Color(255, 255, 255, 220)); NAPI.Marker.CreateMarker(1, CityhallCheckpoints[6] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1, new Color(255, 255, 255, 220)); NAPI.Marker.CreateMarker(1, CityhallCheckpoints[7] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1, new Color(255, 255, 255, 220)); NAPI.Marker.CreateMarker(1, CityhallCheckpoints[8] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1, new Color(255, 255, 255, 220)); NAPI.Marker.CreateMarker(1, CityhallCheckpoints[9] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1, new Color(255, 255, 255, 220)); #region lift in cityhall for (int i = 8; i < 9; i++) { Cols.Add(i, NAPI.ColShape.CreateCylinderColShape(CityhallCheckpoints[i], 1, 2, 0)); // lift in cityhall Cols[i].OnEntityEnterColShape += city_OnEntityEnterColShape; Cols[i].OnEntityExitColShape += city_OnEntityExitColShape; Cols[i].SetData("INTERACT", 602); NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Вход на крышу"), new Vector3(CityhallCheckpoints[i].X, CityhallCheckpoints[i].Y, CityhallCheckpoints[i].Z + 1), 5F, 0.3F, 0, new Color(255, 255, 255)); NAPI.Marker.CreateMarker(22, CityhallCheckpoints[i] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1, new Color(255, 255, 255, 220)); } for (int i = 5; i < 8; i++) { Cols.Add(i, NAPI.ColShape.CreateCylinderColShape(CityhallCheckpoints[i], 1, 2, 0)); // lift on roof Cols[i].OnEntityEnterColShape += city_OnEntityEnterColShape; Cols[i].OnEntityExitColShape += city_OnEntityExitColShape; Cols[i].SetData("INTERACT", 602); NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Выход на на 2 этаж"), new Vector3(CityhallCheckpoints[8].X, CityhallCheckpoints[8].Y, CityhallCheckpoints[8].Z + 1), 5F, 0.3F, 0, new Color(255, 255, 255)); NAPI.Marker.CreateMarker(1, CityhallCheckpoints[i] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1, new Color(255, 255, 255, 220)); } #endregion #region back door Cols.Add(9, NAPI.ColShape.CreateCylinderColShape(CityhallCheckpoints[9], 1, 2, 0)); // back door exit Cols[9].OnEntityEnterColShape += city_OnEntityEnterColShape; Cols[9].OnEntityExitColShape += city_OnEntityExitColShape; Cols[9].SetData("INTERACT", 606); NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Запасной выход/вход"), new Vector3(CityhallCheckpoints[9].X, CityhallCheckpoints[9].Y, CityhallCheckpoints[9].Z + 1), 5F, 0.3F, 0, new Color(255, 255, 255)); NAPI.Marker.CreateMarker(1, CityhallCheckpoints[9] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1, new Color(255, 255, 255, 220)); Cols.Add(10, NAPI.ColShape.CreateCylinderColShape(CityhallCheckpoints[10], 1, 2, 0)); // back door enter Cols[10].OnEntityEnterColShape += city_OnEntityEnterColShape; Cols[10].OnEntityExitColShape += city_OnEntityExitColShape; Cols[10].SetData("INTERACT", 606); NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Запасной вход"), new Vector3(CityhallCheckpoints[10].X, CityhallCheckpoints[10].Y, CityhallCheckpoints[10].Z + 1), 5F, 0.3F, 0, new Color(255, 255, 255)); NAPI.Marker.CreateMarker(1, CityhallCheckpoints[10] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1, new Color(255, 255, 255, 220)); #endregion /*Cols.Add(6, NAPI.ColShape.CreateCylinderColShape(CityhallCheckpoints[6], 1f, 2, 0)); // Оружейка * Cols[6].OnEntityEnterColShape += city_OnEntityEnterColShape; * Cols[6].OnEntityExitColShape += city_OnEntityExitColShape; * Cols[6].SetData("INTERACT", 62); * NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Открыть шкафчик"), new Vector3(CityhallCheckpoints[6].X, CityhallCheckpoints[6].Y, CityhallCheckpoints[6].Z + 0.7), 5F, 0.4F, 0, new Color(255, 255, 255));*/ NAPI.Object.CreateObject(0x4f97336b, new Vector3(260.651764, 203.230209, 106.432785), new Vector3(0, 0, 160.003571), 255, 0); NAPI.Object.CreateObject(0x4f97336b, new Vector3(258.209259, 204.120041, 106.432785), new Vector3(0, 0, -20.0684872), 255, 0); NAPI.Object.CreateObject(0x4f97336b, new Vector3(259.09613, 212.803894, 106.432793), new Vector3(0, 0, 70.0000153), 255, 0); NAPI.Object.CreateObject(0x4f97336b, new Vector3(259.985962, 215.246399, 106.432793), new Vector3(0, 0, -109.999962), 255, 0); } catch (Exception e) { Log.Write("EXCEPTION AT\"FRACTIONS_CITYHALL\":\n" + e.ToString(), nLog.Type.Error); } }
public void onResourceStart() { try { Cols.Add(0, NAPI.ColShape.CreateCylinderColShape(Points[0], 1, 2, 0)); // job placement Cols[0].OnEntityEnterColShape += JobMenu_onEntityEnterColShape; // job placement point handler NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Jobs"), new Vector3(Points[0].X, Points[0].Y, Points[0].Z + 0.5), 10F, 0.3F, 0, new Color(255, 255, 255)); NAPI.Marker.CreateMarker(1, Points[0] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); //FractionManager - костыль NAPI.Blip.CreateBlip(589, new Vector3(1571.831, 2240.648, 78.40011), 1.3f, 75, Main.StringToU16("Merryweather Security"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(494, FractionSpawns[16], 1, 20, Main.StringToU16("The Lost"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(590, new Vector3(-1072.655, -246.5676, 53.506), 1, 45, Main.StringToU16("News"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(419, new Vector3(-545.0524, -204.0801, 37.09514), 1.5f, 14, Main.StringToU16("Cityhall"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(61, new Vector3(-448.1993, -340.8513, 33.3818), 1, 49, Main.StringToU16("Hospital"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(88, new Vector3(-1581.552, -557.9453, 33.83302), 1, 58, Main.StringToU16("FIB"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(526, new Vector3(452.4479, -980.1406, 29.68958), 1, 38, Main.StringToU16("Police"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(85, new Vector3(-108.0619, -2414.873, 5.000001), 1, 28, Main.StringToU16("Army"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(84, FractionSpawns[1], 1, 52, Main.StringToU16("The Families"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(84, FractionSpawns[2], 1, 58, Main.StringToU16("The Ballas"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(84, FractionSpawns[3], 1, 28, Main.StringToU16("Los Santos Vagos"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(84, FractionSpawns[4], 1, 74, Main.StringToU16("Marabunta Grande"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(84, FractionSpawns[5], 1, 49, Main.StringToU16("Blood Street"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(78, FractionSpawns[10], 1, 5, Main.StringToU16("La Cosa Nostra"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(78, FractionSpawns[11], 1, 4, Main.StringToU16("Russian Mafia"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(78, FractionSpawns[12], 1, 76, Main.StringToU16("Yakuza"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(78, FractionSpawns[13], 1, 40, Main.StringToU16("Armenian Mafia"), 255, 0, true, 0, 0); // blips NAPI.Blip.CreateBlip(354, new Vector3(724.9625, 133.9959, 79.83643), 1.5f, 46, Main.StringToU16("Power Station"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(408, new Vector3(105.4633, -1568.843, 28.60269), 1, 3, Main.StringToU16("Postal"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(198, new Vector3(903.3215, -191.7, 73.40494), 1, 46, Main.StringToU16("Taxi"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(198, new Vector3(1956.65015, 3769.12817, 31.0833454), 1, 46, Main.StringToU16("Taxi"), 255, 0, true, 0, 0);//TODOTAXI NAPI.Blip.CreateBlip(198, new Vector3(1791.82837, 4586.595, 36.2361145), 1, 46, Main.StringToU16("Taxi"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(513, new Vector3(462.6476, -605.5295, 27.49518), 1, 30, Main.StringToU16("Bus"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(512, new Vector3(-1331.475, 53.58579, 53.53268), 1, 2, Main.StringToU16("Lanwmower"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(477, new Vector3(588.2037, -3037.641, 6.303829), 1, 4, Main.StringToU16("Trucker"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(477, new Vector3(338.9279, 3417.426, 35.38838), 1, 4, Main.StringToU16("Trucker"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(477, new Vector3(-2212.77, 4249.193, 46.17959), 1, 4, Main.StringToU16("Trucker"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(67, new Vector3(915.9069, -1265.255, 25.52912), 1, 63, Main.StringToU16("Collector"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(67, new Vector3(-1481.75537, -508.08847, 31.6868382), 1, 63, Main.StringToU16("Collector"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(67, new Vector3(-144.374817, 6354.90869, 30.3706112), 1, 63, Main.StringToU16("Collector"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(446, new Vector3(473.9508, -1275.597, 29.60513), 1, 40, Main.StringToU16("Auto Mechanic"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(225, new Vector3(-501.78833, 61.4290543, 56.57218), 1, 33, Main.StringToU16("Rent-a-Car"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(495, new Vector3(-1108.662, -1690.129, 3.254202), 1, 84, Main.StringToU16("Rent-a-Cycle"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(471, new Vector3(-1625.545, -1164.137, 0.2994334), 1, 38, Main.StringToU16("Rent-a-Boat"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(80, Truckers.getProduct[0], 1, 84, Main.StringToU16("Products stock"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(80, Truckers.getProduct[1], 1, 36, Main.StringToU16("Fuel stock"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(80, Truckers.getProduct[2], 1, 15, Main.StringToU16("Auto stock"), 255, 0, true, 0, 0); NAPI.Blip.CreateBlip(80, Truckers.getProduct[3], 1, 62, Main.StringToU16("Guns stock"), 255, 0, true, 0, 0); // markers NAPI.Marker.CreateMarker(1, new Vector3(105.4633, -1568.843, 28.60269) - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); NAPI.Marker.CreateMarker(1, new Vector3(106.2007, -1563.748, 28.60272) - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); NAPI.Marker.CreateMarker(1, new Vector3(-0.51, -436.71, 38.74) - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255, 220)); } catch (Exception e) { Log.Write("ResourceStart: " + e.Message, nLog.Type.Error); } }
public void OnResourceStartHandler() { try { NAPI.TextLabel.CreateTextLabel("~g~Tom Logan", new Vector3(253.9357, 228.9332, 102.6832), 5f, 0.3f, 0, new Color(255, 255, 255), true, NAPI.GlobalDimension); NAPI.TextLabel.CreateTextLabel("~g~Lorens Hope", new Vector3(262.7953, 220.5285, 102.6832), 5f, 0.3f, 0, new Color(255, 255, 255), true, NAPI.GlobalDimension); NAPI.TextLabel.CreateTextLabel("~g~Heady Hunter", new Vector3(247.6933, 219.5379, 107.1669), 5f, 0.3f, 0, new Color(255, 255, 255), true, NAPI.GlobalDimension); Cols.Add(0, NAPI.ColShape.CreateCylinderColShape(CityhallChecksCoords[0], 1f, 2, 0)); // Оружейка Cols[0].OnEntityEnterColShape += city_OnEntityEnterColShape; Cols[0].OnEntityExitColShape += city_OnEntityExitColShape; Cols[0].SetData("INTERACT", 9); NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Press E, to open gun menu"), new Vector3(CityhallChecksCoords[0].X, CityhallChecksCoords[0].Y, CityhallChecksCoords[0].Z + 0.7), 5F, 0.4F, 0, new Color(255, 255, 255)); Cols.Add(1, NAPI.ColShape.CreateCylinderColShape(CityhallChecksCoords[1], 1f, 2, 0)); // Раздевалка Cols[1].OnEntityEnterColShape += city_OnEntityEnterColShape; Cols[1].OnEntityExitColShape += city_OnEntityExitColShape; Cols[1].SetData("INTERACT", 1); NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Press E, to change clothes"), new Vector3(CityhallChecksCoords[1].X, CityhallChecksCoords[1].Y, CityhallChecksCoords[1].Z + 0.7), 5F, 0.4F, 0, new Color(255, 255, 255)); for (int i = 2; i < 4; i++) { Cols.Add(i, NAPI.ColShape.CreateCylinderColShape(CityhallChecksCoords[i], 1, 2, 0)); Cols[i].OnEntityEnterColShape += city_OnEntityEnterColShape; Cols[i].OnEntityExitColShape += city_OnEntityExitColShape; Cols[i].SetData("INTERACT", 5); NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Press E"), new Vector3(CityhallChecksCoords[i].X, CityhallChecksCoords[i].Y, CityhallChecksCoords[i].Z + 1), 5F, 0.3F, 0, new Color(255, 255, 255)); NAPI.Marker.CreateMarker(21, CityhallChecksCoords[i] + new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 0.8f, new Color(255, 255, 255, 60)); } /*int door = 0; * for (int i = 4; i < 6; i++) * { * Cols.Add(i, NAPI.ColShape.CreateCylinderColShape(CityhallChecksCoords[i], 1, 2, 0)); * Cols[i].OnEntityEnterColShape += city_OnEntityEnterColShape; * Cols[i].OnEntityExitColShape += city_OnEntityExitColShape; * Cols[i].SetData("INTERACT", 3); * Cols[i].SetData("DOOR", door); * door++; * }*/ Cols.Add(6, NAPI.ColShape.CreateCylinderColShape(new Vector3(255.2283, 223.976, 102.3932), 3, 2, 0)); Cols[6].OnEntityEnterColShape += city_OnEntityEnterColShape; Cols[6].OnEntityExitColShape += city_OnEntityExitColShape; Cols[6].SetData("INTERACT", 4); NAPI.Marker.CreateMarker(1, CityhallChecksCoords[0] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1, new Color(255, 255, 255, 220)); NAPI.Marker.CreateMarker(1, CityhallChecksCoords[1] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1, new Color(255, 255, 255, 220)); NAPI.Marker.CreateMarker(1, CityhallChecksCoords[6] - new Vector3(0, 0, 0.7), new Vector3(), new Vector3(), 1, new Color(255, 255, 255, 220)); Cols.Add(7, NAPI.ColShape.CreateCylinderColShape(CityhallChecksCoords[6], 1f, 2, 0)); // Оружейка Cols[7].OnEntityEnterColShape += city_OnEntityEnterColShape; Cols[7].OnEntityExitColShape += city_OnEntityExitColShape; Cols[7].SetData("INTERACT", 62); NAPI.TextLabel.CreateTextLabel(Main.StringToU16("~g~Press E, to open gun menu"), new Vector3(CityhallChecksCoords[6].X, CityhallChecksCoords[6].Y, CityhallChecksCoords[6].Z + 0.7), 5F, 0.4F, 0, new Color(255, 255, 255)); NAPI.Object.CreateObject(0x4f97336b, new Vector3(260.651764, 203.230209, 106.432785), new Vector3(0, 0, 160.003571), 255, 0); NAPI.Object.CreateObject(0x4f97336b, new Vector3(258.209259, 204.120041, 106.432785), new Vector3(0, 0, -20.0684872), 255, 0); NAPI.Object.CreateObject(0x4f97336b, new Vector3(259.09613, 212.803894, 106.432793), new Vector3(0, 0, 70.0000153), 255, 0); NAPI.Object.CreateObject(0x4f97336b, new Vector3(259.985962, 215.246399, 106.432793), new Vector3(0, 0, -109.999962), 255, 0); } catch (Exception e) { Log.Write("EXCEPTION AT\"FRACTIONS_CITYHALL\":\n" + e.ToString(), nLog.Type.Error); } }
public virtual IRepositoryConfig AddCol(string name, DataType Type) { Cols.Add(name, Type); return(this); }
private void InnerInitialize() { for (int r = 0; r < 9; r++) { Nine row = new Nine { Attribute = string.Format("Row: {0}", r + 1) }; for (int c = 0; c < 9; c++) { row.Add(new Cell { Col = c, Row = r }); } Rows.Add(row); } for (int r = 0; r < 9; r++) { Nine col = new Nine { Attribute = string.Format("Column: {0}", r + 1) }; (from Nine nine in Rows select nine[r]).Each(cell => col.Add(cell)); Cols.Add(col); } for (int r = 0; r < 9; r++) { Nine group = new Nine { Attribute = string.Format("Group: {0}", r + 1) }; for (int c = 0; c < 9; c++) { int rmod3 = r % 3; int cmod3 = c % 3; int r3 = r / 3; int c3 = c / 3; int gIdx = r3 * 3 + c3; int cInd = rmod3 * 3 + cmod3; group.Add(Rows[r3 * 3 + c3][rmod3 * 3 + cmod3]); } Groups.Add(group); } if (IsX) { Nine slashF = new Nine { Attribute = "Slash Forward" }; Nine slashB = new Nine { Attribute = "Backslash" }; for (int i = 0; i < 9; i++) { slashB.Add(Rows[i][i]); slashF.Add(Rows[8 - i][i]); } ExtraConstraints.Add(slashB); ExtraConstraints.Add(slashF); } AllContraints.AddRange(Rows.Union(Cols).Union(Groups).Union(ExtraConstraints)); (from Nine nine in AllContraints select nine).Each(nine => { nine.OnValidationError += new Action <Nine>(nine_OnValidationError); }); }