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

Drop items after death


KaRambi
 Share

Recommended Posts

[http://www.touchofde…arch-something/](http://www.touchofdeathforums.com/community/index.php?/topic/131008-how-to-search-something/)

Don't look for a specific title. Try using simple keywords. For example, "Death"

![](http://www.freemmorpgmaker.com/files/imagehost/pics/11caa851249335dbe8b6f5621874c43c.png)

~ Tada ~

Now lets open up the tutorial

> Ok soo this basicly works by making you drop your items only if you are a Playerkiller when you die.

Now we see that this is more or less relevant to what you want, so let's take a look at the code!

> OK this is a very very simple server sided edit, you do not have to touch the client side at all.
>
> First off go to modPlayer and find this:
>
> ```
> ' Drop all worn items
>
> For i = 1 To Equipment.Equipment_Count - 1
>
> If GetPlayerEquipment(index, i) > 0 Then
>
> PlayerMapDropItem index, GetPlayerEquipment(index, i), 0
>
> End If
>
> Next
> ```

See if you can find something like that in your server code. It should be in a sub related to dying.

> And replace that with this:
>
> ```
>
> 'Drop inventory items, Will make this only apply to player killers.
>
> If GetPlayerPK(index) = YES Then
>
> For i = 1 To MAX_INV
>
> PlayerMapDropItem index, i, GetPlayerInvItemValue(index, i)
>
> Next
>
> 'Send all equiped items to the inventory to be dumped.
>
> For i = 1 To Equipment.Equipment_Count - 1
>
> If GetPlayerEquipment(index, i) > 0 Then
>
> PlayerMapDropItem index, GetPlayerEquipment(index, i), 0
>
> End If
>
>
>
> 'Send Weapon
>
> GiveInvItem index, GetPlayerEquipment(index, Weapon), 0
>
> SetPlayerEquipment index, 0, Weapon
>
> 'Send Armor
>
> GiveInvItem index, GetPlayerEquipment(index, Armor), 0
>
> SetPlayerEquipment index, 0, Armor
>
> 'Send Shield
>
> GiveInvItem index, GetPlayerEquipment(index, Shield), 0
>
> SetPlayerEquipment index, 0, Shield
>
> 'Send Helmet
>
> GiveInvItem index, GetPlayerEquipment(index, Helmet), 0
>
> SetPlayerEquipment index, 0, Helmet
>
>
>
> Next
>
> 'Drop *equipped* inventory items
>
> For i = 1 To MAX_INV
>
> PlayerMapDropItem index, i, 0
>
> Next
>
> End If
>
> ```
>
> And BAM! your done.

But this isn't exactly what you want. You want it so that when a player dies, they lose everything no matter if they're a player killer or not. Let's see if we can change it to what you want. At the top of the code, we see this.

```
'Drop inventory items, Will make this only apply to player killers.

If GetPlayerPK(index) = YES Then
```

I'm fairly certain that's what we have to remove. But keep in mind that an if statement like this has to be closed off with an "end if". So lets see if we can find where the if statement is closed off at.

Sure enough, at the bottom of the code is this.

```
'Drop *equipped* inventory items

For i = 1 To MAX_INV

PlayerMapDropItem index, i, 0

Next

End If
```

You'll want to remove the [background=rgb(248, 248, 248)]```
If GetPlayerPK(index) = YES Then
```[/background]

and the [background=rgb(248, 248, 248)]```
End If
```[/background]

Save it, run it, and tell me what happens.
Link to comment
Share on other sites

hi dude if u dont fix the problem about when ur player death and drop all thing you have in your bag this is the solution

server side –-)mobplayer

go to sud ondeath and find this:

'Drop *equipped* inventory items

For i = 1 To MAX_INV

PlayerMapDropItem index, i, 0

Next

just delete and the problem is fix ur player no drop nothing when he death all stay in ur bag

but other problem is when he die the item u have equiment all go to bag and u need to put again.

sorry for my bad english. tell me if u fix that problem. ok ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)
Link to comment
Share on other sites

Yea u think good but it cant work. I have too bad english so ![;)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/wink.png) I delete everything and it cant work.. After death i drop all items ;/ ahh can someone just send me Source? with it…
Link to comment
Share on other sites

let try one more time ok

in server side u know that mobplayer

you need to find this

'Drop inventory items

For i = 1 To MAX_INV

PlayerMapDropItem index, i, GetPlayerInvItemValue(index, i)

Next

delete it.

then

'Drop *equipped* inventory items

For i = 1 To MAX_INV

PlayerMapDropItem index, i, 0

Next

and other point if u dont wanna send urs item to your inventory (the bag)

delete this too.

'Send all equiped items to the inventory to be dumped.

For i = 1 To Equipment.Equipment_Count - 1

If GetPlayerEquipment(index, i) > 0 Then

PlayerMapDropItem index, GetPlayerEquipment(index, i), 0

End If

'Send Weapon

GiveInvItem index, GetPlayerEquipment(index, Weapon), 0

SetPlayerEquipment index, 0, Weapon

'Send Armor

GiveInvItem index, GetPlayerEquipment(index, Armor), 0

SetPlayerEquipment index, 0, Armor

'Send Shield

GiveInvItem index, GetPlayerEquipment(index, shield), 0

SetPlayerEquipment index, 0, shield

'Send Helmet

GiveInvItem index, GetPlayerEquipment(index, helmet), 0

SetPlayerEquipment index, 0, helmet

Next

then u you do all that when ur player die all weapons and stay put.

are u using vb6 and compilate all the thing u do for save the project? cuz if u dont use this no work for you.
Link to comment
Share on other sites

Hey,

At the moment I am having problems with my VB6\. so I can not upload a version with it at the moment. However pikachu2010 has explained it really well and what he has said should work fine. As Matthew and pikachu2010 have said remember to compile it otherwise none of the changes you make will work when you run it from the exe.

Hope you manage to get it working.

Santini
Link to comment
Share on other sites

Yea… i do everything what you said and buum .. nothing.. after death there write "You drop 10 monety" so... god why ? ![:mellow:](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/mellow.png) I was using VB i delete everything what sou said and nothing.. nothing ![:ph34r:](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/ph34r.png) ... nothing ![:(](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/sad.png)

Some suggestions ![:o](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/ohmy.png) ?
Link to comment
Share on other sites

  • 2 weeks later...

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...