示例#1
0
        private void LoadBlip()
        {
            Invoker.ClearList(listView1);

            Invoker.ChangeVisible(metroProgressSpinner1, true);

            List <GTAObject> objects = new List <GTAObject>();

            for (int i = 3; i < 0x800; i++)
            {
                try
                {
                    IntPtr    addr = IntPtr.Add(Base.BlipPTR, i * 8);
                    GTAObject obj  = new GTAObject(addr);
                    if (obj.ID() > 0)
                    {
                        if (obj.ID() > 1000)
                        {
                            break;;
                        }
                        objects.Add(obj);
                    }
                }
                catch { continue; }
            }

            Invoker.ProgressSpinner_SetMaximum(Form1.frm.metroProgressSpinner1, objects.Count);
            Invoker.UpdateList(listView1, true);
            int objCount = 1;

            foreach (GTAObject obj in objects)
            {
                if (obj.GetBlip() == GTAObject.BlipSprite.Player)
                {
                    continue;
                }
                Invoker.ProgressSpinner_SetValue(Form1.frm.metroProgressSpinner1, objCount);
                objCount++;
                ListViewItem itm = new ListViewItem();
                itm.Text = obj.GetName();
                itm.SubItems.Add(obj.Pos_X().ToString());
                itm.SubItems.Add(obj.Pos_Y().ToString());
                itm.Tag = obj;
                Invoker.AddListItem(listView1, itm);
            }

            Invoker.ChangeVisible(Form1.frm.metroProgressSpinner1, false);
            Invoker.UpdateList(listView1, false);
        }
示例#2
0
        public void TPToObject(GTAObject obj)
        {
            if (obj.ID() > 0)
            {
                if (World.structs.GetValue <int>("IN_VEHICLE") == 0)
                {
                    Vehicle vehicle = Vehicle.CurrenVehicle();
                    if (vehicle != null)
                    {
                        vehicle.Set_PosX(obj.Pos_X());
                        vehicle.Set_PosY(obj.Pos_Y());
                        vehicle.Set_PosZ(-210f);
                    }
                }

                World.structs.SetValue("POS_X", obj.Pos_X());
                World.structs.SetValue("POS_Y", obj.Pos_Y());
                World.structs.SetValue("POS_Z", -210f);
                return;
            }
        }