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

Source need Help


PVJsquad
 Share

Recommended Posts

I had a problem with the source of my own, first of all I have made frmEditor to create a kind of text that can be accessed and produce an item.
such claim code
like this:

>! ![](http://www.freemmorpgmaker.com/files/imagehost/pics/db519942b3345dbb2590bcdaa8eaa333.bmp)

nah, after I make a database like the picture above, I want to create a textbox and a command to get the right item
and on the button that I insert a code to claim the item
```
Private Sub Command5_Click()
Dim a As String

a = Serial(1).Name

If Text1.text = a Then
SendSpawnItem Serial(EditorIndex).Item, Serial(EditorIndex).ItemValue
CheckMapGetItem
Else
MsgBox "Wrong Code!!!"
End If
End Sub
```
in this code **a = Serial (1). Name** I can only access the first database saja.jika I change it with **a = Serial (2). Name** can only access the second database.

so, I would like to ask how can I make the database **a = Serial (x). Name** can be accessed in full, without changing the **x** and can access all the databases to get the Item

Sorry i use Translate
Link to comment
Share on other sites

>.< your code is very unusual to use in an editor anyway…. you might want to look at how other editors have their code.

Unless that's for the actual Use of the serial system, in that case you have that COMPLETELY messed up.

you cant use a constant to set a to something, and you cant use EditorIndex outside an editor. If you want to check if a code exist you are going to have to loop though them all until you find the right one, there is no getting around that.

You might want to revise your entire sub

try somthing along the lines of

```
Private Sub Command5_Click()
Dim a As String

For a = 1 to MAX_SERIAL 'or what ever you called it

    If Text1.text = Serial (a). Name Then
        SendSpawnItem Serial(a).Item, Serial(a).ItemValue
        CheckMapGetItem
        Exit Sub
    End If

Next

MsgBox "Wrong Code!!!"
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...