Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Do not pick up item


nneader
 Share

Recommended Posts

I want to be able to place an item on the map as an admin and NOT be able to be picked up by anyone else except another admin.

I thought maybe a check box on the item editor named, "no pick up" or "admin only" for that specific item.

I know this could be possible, however, I am not sure how to do this.  Can anyone point me in the right direction or maybe something like this exists?  I searched for awhile, however, came up short.

I thought it would be cool to place something (for example a fire) and not have anyone else be able to pick it up…

Thanks in advance.

NN
Link to comment
Share on other sites

i have to ideas for you.

1\. give the admin's an item called "admin" or something else and make before the item you want only admin to pick key and then when an admin comes he will have to double click on the "admin" item to enter and pick up the item.

2\. if it's equipment or spell, the put the access req to 5 and then only admin can use them.

enjoy,
omerg7  :star: :rstar: :bstar:
Link to comment
Share on other sites

I haven't tested this for myself, but I'd imagine this would work.

Server-side, there's a sub called "PlayerMapGetItem". I imagine, with all the other checks, that checks for whether there's actually an item there, whether the player has a free inv. slot, etc, you can add something like:

```
    If Item(MapItem(mapNum, i)).AdminPickupOnly = True Then
        If Player(Index).Access < ADMIN_MAPPER Then
            ' They're not a member of staff, tell them they can't pick it up.
            Exit Sub
        Else
            ' They are, so carry on as normal.
        End If
    Else
        ' It's not an admin-only pickup, so, just carry on as normal.
    End If
```
In order to help you learn, I won't tell you what goes in between the commented sections, but having a quick read at the original sub should tell you what goes where, and it should be easy enough to follow.
Link to comment
Share on other sites

Thanks for the response.

Just so I am clear….
I am assuming the AdminPickupOnly is a variable I am going to declare.
Also ADMIN_MAPPER is an established variable (probably global since it's in all caps)??

Thanks!
Link to comment
Share on other sites

Thanks for clearing that up.  :cheesy:

Searching the forums, I found this little gem of a tutorial:  [http://www.touchofdeathforums.com/smf/index.php?topic=35449.0](http://www.touchofdeathforums.com/smf/index.php?topic=35449.0)
It is pretty much what I want to do….add another property to the item editor, in my case "Admin pickup".

The question I have.
Does this tutorial (listed above) still work with EO 2.0?

Thanks!
Link to comment
Share on other sites

Hello,

I have been trying to get this working, however, I am running into a bit of snags.
My player can drop things (admin or not), however, my player cannot pick it up, even as admin.

Can you tell me the existing code (EO2.0) that I need to place in the …
" **They are, so carry on as normal.**"  and  " **It's not an admin-only pickup, so, just carry on as normal**" (from previous reply) 

Side note:

> If Item(MapItem(mapNum, i)).AdminPickupOnly = True Then

In the above, I noticed that it should be **If Item(MapItem(mapNum, i).NUM).AdminPickupOnly = True Then** < Thanks.  I am still learning  :cheesy:
Link to comment
Share on other sites

At the side-note, yes, that'd be correct, I missed it out by mistake.

Another little tip: The code is EXACTLY the same as it would be, you just add another "If Player(Index).Access >= ADMIN_MAPPER (Or whatever access level you want)" to make sure that the access level you want is the only one that can pick it up.
Link to comment
Share on other sites

@Likestodraw:

> It sounds like you need some sort of map-animation system.

That is exactly what I am doing AND it seems to be working like a charm.  I am using the existing item animation that is already in play.    I have 32 x 32 "tiles" that sit on top of the ground and on top of the fringe…so my animation can play at any level.  May not be the greatest system, however, it is a system  :cheesy:

The only downer is that to build a 64 x 64 animated tile, I need 4 items.  Oh well, small price to pay.

Peace,
NN
Link to comment
Share on other sites

I would do it this way. It doesn't require adding new variables. It checks the access level required on the item, and if the user cant use it the user cant pick up the item.

```
    If Item(MapItem(mapnum, i)).AccessReq <= Player(index).Access Then
        'can pick up the item, since the access req on the item is lower than player's access.
    Else
        'can't pick up the item since the accessreq on the item is too high, so item is unusable. can insert some error msg here if you want
    End If

```
Link to comment
Share on other sites

@Lenn:

> Rather than do that…why not make an actual tile animation system, or add a new tile-type in the editor that allows you to place animations on the map?

I 100% agree, however, I thought the item way may be perfect for me at my programming lvl.

I want to eventually get a tile system going…...
Link to comment
Share on other sites

If you're looking for an animation system, this one [[url=http://www.touchofdeathforums.com/smf2/index.php/topic,79806.msg855308.html#msg855308]http://www.touchofdeathforums.com/smf2/index.php/topic,79806.msg855308.html#msg855308] allows you to place animations (from the animation editor) down on your map as an attribute.
Link to comment
Share on other sites

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
 Share

×
×
  • Create New...