|
-
Jan 12th, 2003, 12:29 PM
#1
Thread Starter
Addicted Member
object enabled
For my game you will have to buy items but i cant figure out how to make it be like - You dont have a 'gun' or You have put on the Gun.
But even when i do this /wear rocket, it works when i havnt even bought the item.
so my question is, how can i get it so that the p rogram knows that i have one thing, and not the other item?
VB Code:
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If TextBox1.Text = "" And (Asc(e.KeyChar)) = 13 Then
MsgBox("Need to type something")
ElseIf TextBox1.Text = "/buy gun" Then
chatwin.Text = chatwin.Text & vbCrLf & "You have bought a Paintball gun for $150"
TextBox1.Clear()
ElseIf TextBox1.Text = "/buy tube" Then
chatwin.Text = chatwin.Text & vbCrLf & "You have bought a tube of paintballs for $30"
TextBox1.Clear()
ElseIf TextBox1.Text = "/wear gun" Then
chatwin.Text = chatwin.Text & vbCrLf & "You have put on" & gun
TextBox1.Clear()
ElseIf (Asc(e.KeyChar)) = 13 Then
chatwin.Text = chatwin.Text & vbCrLf & (UserName) & ":" & " " & TextBox1.Text
TextBox1.Clear()
End If
End Sub
-
Jan 12th, 2003, 02:00 PM
#2
You should use a collection for the items that are available and another one for items that you have. Then before using an item you should see if it is in the collection of items you have.
-
Jan 12th, 2003, 02:10 PM
#3
Thread Starter
Addicted Member
so should i have like a list inventory and make it like
If ' ' ' = /buy gun then
linventory.items.add"gun"
or something like that right?
-
Jan 12th, 2003, 03:52 PM
#4
Thread Starter
Addicted Member
Also how can i make it so that if the item is not in the listbox(inventory) it will say "its not there" in other words how can i make the program check to see if there is an item on the person.?
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|