Sign in to follow this  
Arn Olsen

Ban on loot inventory of some NPCs

5 posts in this topic

I need to make sure that players can not take loot from some NPCs. I tried to insert such code in the unit initialization field:

player addEventHandler ["InventoryOpened",{
        _this spawn {
            waitUntil {
                not isNull findDisplay 602
            };
            if (_this select 1 isKindOf "Man") then {closeDialog 602}
        }
}];

But it works for me only in the editor. On the server corpses still can be robbed. How to do it?

Edited by Arn Olsen

Share this post


Link to post
Share on other sites

Might be easier to setup a spawning script and a death script for your mission if that's what you're doing. When killed strip the body of whatever items you don't want players to have.

Or even just a death script that checks all dead bodies and removes the items you don't want players to have.

Edited by Beowulfv

Share this post


Link to post
Share on other sites
Advertisement

Is it so much easier? I just need 3 units possessed such qualities. On the whole big map with hundreds of emerging NPCs, I only need this three. It will be something like a boss who will have a unique weapon and armor, which should not be left to the players. So I'm just looking for the correct code that would load the "init" field of the three units.

Edited by Arn Olsen

Share this post


Link to post
Share on other sites

Just look towards the respect tier loadouts and revers engineer them to work for all dead bodies. You'll find your answer, and it'll be custom code that no one has access to.

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.