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

Taking items away


jdf318
 Share

Recommended Posts

Add this to the bottom of your main.txt:

```
Sub TakeItem(index, item, value)
If value = "all" Then
SLOT = 1
Do While SLOT < 25
If GetPlayerInvItemNum(index, SLOT) = item Then
Call SetPlayerInvItemNum(index, SLOT, 0)
Call SetPlayerInvItemValue(index, SLOT, 0)
Call SendInventoryUpdate(index, SLOT)
SLOT = 25
End If
SLOT = SLOT+1
Loop
Else
SLOT = 1
Do While SLOT < 25
If GetPlayerInvItemNum(index, SLOT) = item Then
Call SetPlayerInvItemNum(index, SLOT, 0)
Call SetPlayerInvItemValue(index, SLOT, GetPlayerInvItemValue(index, SLOT) - value)
Call SendInventoryUpdate(index, SLOT)
SLOT = 25
End If
SLOT = SLOT+1
Loop
End If
End Sub
```
And now you can say

Call TakeItem(index, item#, # of items)

to take an item from a player.
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...