PVJsquad Posted March 10, 2012 Author Share Posted March 10, 2012 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 codelike 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 itemand on the button that I insert a code to claim the item```Private Sub Command5_Click()Dim a As Stringa = Serial(1).NameIf Text1.text = a ThenSendSpawnItem Serial(EditorIndex).Item, Serial(EditorIndex).ItemValueCheckMapGetItemElseMsgBox "Wrong Code!!!"End IfEnd 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 ItemSorry i use Translate Link to comment Share on other sites More sharing options...
RyokuHasu Posted March 10, 2012 Share Posted March 10, 2012 try "a = Serial (EditorIndex). Name" Link to comment Share on other sites More sharing options...
PVJsquad Posted March 10, 2012 Author Share Posted March 10, 2012 @Ryoku:> try "a = Serial (EditorIndex). Name"Run Time error '9' :Subscript out of range>! ![](http://www.freemmorpgmaker.com/files/imagehost/pics/81815343b56f54e0a79300b099ecc592.bmp) Link to comment Share on other sites More sharing options...
RyokuHasu Posted March 10, 2012 Share Posted March 10, 2012 >.< 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 subtry somthing along the lines of```Private Sub Command5_Click()Dim a As StringFor 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 IfNextMsgBox "Wrong Code!!!"End Sub``` Link to comment Share on other sites More sharing options...
kenny92316 Posted March 10, 2012 Share Posted March 10, 2012 In my opinion try either using one variable for each database part 1 and 2 or change the varriable you're using into an array so you don't have an issue with it only reading one data. Link to comment Share on other sites More sharing options...
PVJsquad Posted March 11, 2012 Author Share Posted March 11, 2012 Thank's now i can make claim code Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now