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

Another error in my scripts.


Eviltyphoon
 Share

Recommended Posts

Once again, I ascend from my scripting hell called MyWorld (Not that bad, but I'm gonna request a second scripter :P) to show you what I have and to ask why it doesn't work.

This is what I have:

```
Case 1
Call GlobalMsg("test", 0)
Call Custommenushow(index, "Wanted!", "\GUI\CUSTOM\Wanted.bmp", 1)
Index = 1
Player = 0
Y = 0

Do While Index <> 0
Player = Getplayername(index)
If Getplayername(index) = "" Then
Exit Do
Else
Hasbounty = Getvar("Bounty.ini", "hasbounty", Player & "")
Bounty = Getvar("Bounty.ini", "bounty", Player & "")
Y = Y + 20

If Hasbounty = "1" Then
  If Y < 200 Then
    Call Custommenulabel(index, 8, Player & " has a bounty of " & Bounty & " Gold.", 20, Y & "", 10, 0, 0, 400, 20)
  End if
End if

Index = Index + 1
End if
Loop
Exit Sub
```
What this should do is this: I step on the tile, a custom menu shows up that lists all people who have a bounty. Now, the menu shows, but it only seems to show 1 person. The ini contains this:
```
[bounty]
test=500
aaa=5000
[hasbounty]
test=1
aaa=1

```
Also, I set up the data.ini in my test server to show script errors and I get this:
```
TYPE: Subscript out of range
LINE: 17
COLUMN: 0
CODE:
```
So, I was hoping someone here could fix this for me.

Thx in advance,
Eviltyphoon
Link to comment
Share on other sites

Then you need to remove Index = 1, Player = 0 and Y = 0 and replace Y = Y + 20 with Y = 20 and remove quotations in "1", since you only put quotation marks around strings, and remove Index = Index + 1\. If i get the function of the script right, it should work then. If this is right, then all you need to do is add more custom menu labels.
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...