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

Evolution 2.8 Sad Script Help


ondalor
 Share

Recommended Posts

Hello I am Lonnie

I have had a Eclipse server for a long time (sience 2009)

It Is an EE 2.8 server that has several small simple scripted quests but recently i lost my server and had to start fresh. Any help with restoring the quests would be appreciatedĀ  this is what i have sofar:

I have placed these in my Main.txt

' Gives and takes items

Sub TakeItem(index, item, value)
If value = "all" Then
SLOT = 1
Do While SLOT < 24
If GetPlayerInvItemNum(index, SLOT) = item Then
Call SetPlayerInvItemNum(index, SLOT, 0)
Call SetPlayerInvItemValue(index, SLOT, 0)
Call SendInventoryUpdate(index, SLOT)
SLOT = 24
End If
SLOT = SLOT+1
Loop
End Sub
Else
SLOT = 1
Do While SLOT < 24
If GetPlayerInvItemNum(index, SLOT) = item Then
Call SetPlayerInvItemNum(index, SLOT, 0)
Call SetPlayerInvItemValue(index, SLOT, GetPlayerInvItemValue(index, SLOT) - value)
Call SendInventoryUpdate(index, SLOT)
SLOT = 24
End If
SLOT = SLOT+1
Loop
End Sub
End If

Sub GiveItem(index, item, value)
SLOT = 1
Do While SLOT < 24
If GetPlayerInvItemNum(index, SLOT) = 0 Then
Call SetPlayerInvItemNum(index, SLOT, item)
Call SetPlayerInvItemValue(index, SLOT, value)
Call SendInventoryUpdate(index, SLOT)
SLOT = 24
End If
SLOT = SLOT+1
Loop
End Sub

What i need now is the method to check if an item is in a players inventory. I Used to use:

If CantTakeItem = true then

or something of the sort but i have forgotten :( please i know it says EE isnt supported but any help is appreciated.
Link to comment
Share on other sites

This shoud work i beive but it doesnt seem to. why?

Sub CanTake(index, item, value)
CanTake = false
SLOT = 1
Do While SLOT < 24
If CanTake(index, SLOT) = item Then
CanTake = true
SLOT = 24
End If
SLOT = SLOT+1
Loop
End Sub
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...