Jump to content

XP supply drop

Closed 1.2.9

GamingHQ
GamingHQ

Posted

hi there.

Something small i came across. With the use of fancy airdrop, if a personal supply drop is been thrown and you limit it to the user only first to be looted before its opened for anyone else, if anyone interacts with it before its looted, they obtain XP even if its not their rightfull supply drop.. 

imthenewguy

Posted

You need to ask the owner of the plugin to check how the lock is being implemented.

My xp is awarded once the container has been successfully looted, using the OnLootEntity hook, which is called when the player has been assigned as a looter to the entity.

In order to prevent this, he will need to prevent the player from looting using the CanLootEntity hook, as returning false on this prevents OnLootEntity from firing.

GamingHQ

Posted

private void OnLootEntity(BasePlayer player, BaseEntity entity)
        {
            if (!initialized || entity == null || !(entity is SupplyDrop) || LootedDrops.Contains(entity as SupplyDrop))
                return;

            if ((configData.GenericSettings.lockSignalDrop || configData.GenericSettings.lockDirectDrop) && entity.OwnerID != 0uL && entity.OwnerID != player.userID)
            {
                NextTick(() => player.EndLooting());
                MessageToPlayer(player, msg("msgCrateLocked", player.UserIDString));
                if (configData.DebugSettings.useDebug)
                    Puts($"Drop is locked to {entity.OwnerID.ToString()}");
                return;
            }

            if (entity.OwnerID == player.userID)
            {
                string gridPos = GetGridString(entity.transform.position);
                if (configData.Notifications.notifyDropConsoleLooted)
                    Puts($"{player.displayName} ({player.UserIDString}) looted his Drop at: {entity.transform.position.ToString("0")} grid area: {gridPos}");

                if (!configData.GenericSettings.unlockDropAfterLoot)
                {
                    entity.OwnerID = 0uL;
                    LootedDrops.Add(entity as SupplyDrop);
                }
                return;
            }

            if (Vector3.Distance(lastLootPos, entity.transform.position) > ((lastDropRadius * 2) * 1.2))
            {
                string gridPos = GetGridString(entity.transform.position);

                if (configData.Notifications.notifyDropServerLooted)
                    NotifyOnDropLooted(entity, player);
                if (configData.Notifications.notifyDropConsoleLooted)
                    Puts($"{player.displayName} ({player.UserIDString}) looted the Drop at: {entity.transform.position.ToString("0")} grid area: {gridPos}");
                LootedDrops.Add(entity as SupplyDrop);
                lastLootPos = entity.transform.position;
                return;
            }
        }

its all i could find depending on the hook you mentioned. Sadly, my DM's on umod are not being responded on from a former last bug report i did with simple death notes and the clan tag being triggered twice as every clan plugin uses the same API's over and over again. 

GamingHQ

Posted

wait, i stated that wrong. 

its all i could find depending on the hook you mentioned. Sadly, my DM's on umod are not being responded on. Knowing this from a former last bug report i did with simple death notes and the clan tag being triggered twice as every clan plugin uses the same API's over and over again. 

imthenewguy

Posted

So the plugin uses OnLootEntity to handle the locking, by telling the player to stop looting on the following frame.

It should be using the CanLootEntity hook and returning a false value to prevent the looting to begin with.

Would be worth mentioning it to the developer, as with the current method the player will always get xp.

1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

102.4k

Files Sold

Total number of files sold.

2m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.