Пример #1
0
        static public List <int> GetPickupObjectHandles()
        {
            FindEntityPoolAddress();
            FindPickupPoolAddress();

            GenericPool *pickupPool   = (GenericPool *)(_PickupObjectPoolAddress.ToPointer());
            EntityPool * entitiesPool = (EntityPool *)(_EntityPoolAddress.ToPointer());

            List <int> pickupsHandle = new List <int>();

            for (uint i = 0; i < pickupPool->size; i++)
            {
                if (entitiesPool->IsFull())
                {
                    break;
                }

                if (pickupPool->IsValid(i))
                {
                    ulong address = (ulong)pickupPool->GetAddress(i).ToInt64();

                    if (address != 0)
                    {
                        FindAddEntityToPoolFuncAddress();

                        int handle;
                        handle = _addEntToPoolFunc(address); //this somehow crashes GTA even if address contains a proper memory address value
                        pickupsHandle.Add(handle);
                    }
                }
            }
            return(pickupsHandle);
        }
Пример #2
0
        static public List <IntPtr> GetPickupObjectAddresses()
        {
            if (*_EntityPoolAddress == 0 || *_PickupObjectPoolAddress == 0)
            {
                return(new List <IntPtr>());
            }

            GenericPool *pickupPool   = (GenericPool *)(*_PickupObjectPoolAddress);
            EntityPool * entitiesPool = (EntityPool *)(*_EntityPoolAddress);

            List <IntPtr> pickupsAddresses = new List <IntPtr>();

            for (uint i = 0; i < pickupPool->size; i++)
            {
                if (entitiesPool->IsFull())
                {
                    break;
                }

                if (pickupPool->IsValid(i))
                {
                    ulong address = pickupPool->GetAddress(i);

                    if (address != 0)
                    {
                        pickupsAddresses.Add(new IntPtr((long)address));
                    }
                }
            }
            return(pickupsAddresses);
        }
Пример #3
0
        static public List <IntPtr> GetPickupObjectAddresses()
        {
            FindEntityPoolAddress();
            FindPickupPoolAddress();

            GenericPool *pickupPool   = (GenericPool *)(_PickupObjectPoolAddress.ToPointer());
            EntityPool * entitiesPool = (EntityPool *)(_EntityPoolAddress.ToPointer());

            List <IntPtr> pickupsHandle = new List <IntPtr>();

            for (uint i = 0; i < pickupPool->size; i++)
            {
                if (entitiesPool->IsFull())
                {
                    break;
                }

                if (pickupPool->IsValid(i))
                {
                    long address = pickupPool->GetAddress(i).ToInt64();

                    if (address != 0)
                    {
                        pickupsHandle.Add(new IntPtr(address));
                    }
                }
            }
            return(pickupsHandle);
        }