| View previous topic :: View next topic |
| Author |
Message |
Golden Wing Grandmaster Cheater
Reputation: 0
Joined: 29 Aug 2007 Posts: 905
|
Posted: Tue Nov 06, 2007 4:38 pm Post subject: [Help] Vb6 |
|
|
im making a game a fighting one like when you attack ur healths go down and crap but how do u make the same button take down diffrent value like
| Code: | Private Sub cmdPowerdash_Click()
msgbox " you attacked for 64!"
msgbox "your opponet hit for 86!"
LabelHealthP.caption = "14/100"
LabelHealthE.caption = "36/100"
End Sub
|
and now like if they wanna use the attack again it will hit different and the label will change |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Tue Nov 06, 2007 4:54 pm Post subject: |
|
|
I tossed together a quick example for ya. Hope it helps. _________________
- Retired. |
|
| Back to top |
|
 |
Golden Wing Grandmaster Cheater
Reputation: 0
Joined: 29 Aug 2007 Posts: 905
|
Posted: Tue Nov 06, 2007 4:59 pm Post subject: |
|
|
| Wiccaan wrote: | | I tossed together a quick example for ya. Hope it helps. |
HOLY FUCK!!! your the best programmer i know thx! ima rep u |
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Tue Nov 06, 2007 5:57 pm Post subject: |
|
|
| xDemonRobbiex wrote: | | HOLY FUCK!!! your the best programmer i know thx! ima rep u |
VB != Good programmer. But that aside, Wiccaan is still a good programmer.  |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
|
| Back to top |
|
 |
XxOsirisxX Grandmaster Cheater Supreme
Reputation: 0
Joined: 30 Oct 2006 Posts: 1597
|
Posted: Thu Nov 08, 2007 12:38 am Post subject: |
|
|
This is how u can make multi-actions in just 1 button/label
| Quote: | Private Sub Command1_Click()
If Val(Label1.Caption) = 100 Then
Label1.Caption = 50
MsgBox "Dam u take 50 dmg"
GoTo fin:
ElseIf Val(Label1.Caption) = 50 Then
Label1.Caption = 1
MsgBox "somehow u lose 49 this time"
GoTo fin:
ElseIf Val(Label1.Caption) = 1 Then
Label1.Caption = 0
MsgBox "U r dead!"
fin:
End If
End Sub |
_________________
|
|
| Back to top |
|
 |
AtheistCrusader Grandmaster Cheater
Reputation: 6
Joined: 23 Sep 2006 Posts: 681
|
Posted: Thu Nov 08, 2007 6:21 am Post subject: |
|
|
| XxOsirisxX wrote: | This is how u can make multi-actions in just 1 button/label
| Quote: | Private Sub Command1_Click()
If Val(Label1.Caption) = 100 Then
Label1.Caption = 50
MsgBox "Dam u take 50 dmg"
GoTo fin:
ElseIf Val(Label1.Caption) = 50 Then
Label1.Caption = 1
MsgBox "somehow u lose 49 this time"
GoTo fin:
ElseIf Val(Label1.Caption) = 1 Then
Label1.Caption = 0
MsgBox "U r dead!"
fin:
End If
End Sub |
|
u just made it go to 50 hp then 1 hp, BUT he wanted to get random answers |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Thu Nov 08, 2007 8:22 am Post subject: |
|
|
| XxOsirisxX wrote: | This is how u can make multi-actions in just 1 button/label
| Quote: | Private Sub Command1_Click()
If Val(Label1.Caption) = 100 Then
Label1.Caption = 50
MsgBox "Dam u take 50 dmg"
GoTo fin:
ElseIf Val(Label1.Caption) = 50 Then
Label1.Caption = 1
MsgBox "somehow u lose 49 this time"
GoTo fin:
ElseIf Val(Label1.Caption) = 1 Then
Label1.Caption = 0
MsgBox "U r dead!"
fin:
End If
End Sub |
|
Lol.... GoTos in a If Then statement.. you really don't know VB at all. Not to mention the fact your code is not what he wanted. Why bother posting when you haven't a clue of what you are doing? _________________
- Retired. |
|
| Back to top |
|
 |
XxOsirisxX Grandmaster Cheater Supreme
Reputation: 0
Joined: 30 Oct 2006 Posts: 1597
|
Posted: Thu Nov 08, 2007 9:37 pm Post subject: |
|
|
| Wiccaan wrote: | | XxOsirisxX wrote: | This is how u can make multi-actions in just 1 button/label
| Quote: | Private Sub Command1_Click()
If Val(Label1.Caption) = 100 Then
Label1.Caption = 50
MsgBox "Dam u take 50 dmg"
GoTo fin:
ElseIf Val(Label1.Caption) = 50 Then
Label1.Caption = 1
MsgBox "somehow u lose 49 this time"
GoTo fin:
ElseIf Val(Label1.Caption) = 1 Then
Label1.Caption = 0
MsgBox "U r dead!"
fin:
End If
End Sub |
|
Lol.... GoTos in a If Then statement.. you really don't know VB at all. Not to mention the fact your code is not what he wanted. Why bother posting when you haven't a clue of what you are doing? |
I have more knowledge than you, that is sure. I never give all the options in 1 answer, i just post the answer of multi-actions in 1 button. Also, i take the actions by the example that he make. The random is pretty easy on VB if that where the case. I never read where he says "random" he says, 1 button multiples dmgs and looking for the example, i just think in that. _________________
|
|
| Back to top |
|
 |
Jaetoo Expert Cheater
Reputation: 0
Joined: 03 Sep 2007 Posts: 109 Location: Where am I?
|
Posted: Thu Nov 08, 2007 9:48 pm Post subject: |
|
|
| LOL. Wiccan should be the General Programming Mod. He's hella good at everything. |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Thu Nov 08, 2007 10:09 pm Post subject: |
|
|
| XxOsirisxX wrote: | | I have more knowledge than you, that is sure. I never give all the options in 1 answer, i just post the answer of multi-actions in 1 button. |
Funny how your response to anyone that corrects you is an insult. Typically for you it's "i know more then you". Sadly, this is not the case. You are trying to give an example with shit code that is just plain wrong. I'm not one to judge people for somewhat crap code that could be done better, but yours is just plain wrong.
| XxOsirisxX wrote: | | Also, i take the actions by the example that he make. The random is pretty easy on VB if that where the case. I never read where he says "random" he says, 1 button multiples dmgs and looking for the example, i just think in that. |
| xDemonRobbiex wrote: | | and now like if they wanna use the attack again it will hit different and the label will change |
That would imply he wants it to randomly select a damage amount. He may have not said it directly, but thats what he ment.
I supplied him with working code, he said it worked and it was what he wanted. What was the point for you to add your code in here anyway?
I'm not trying to attack you but you seem to think you are the ruler of the world and when someone tries to help you learn from your mistakes, you blow up and act like god. Admit you're wrong, go back and read up on the language, and go on with things.
| Jaetoo wrote: | | LOL. Wiccan should be the General Programming Mod. He's hella good at everything. |
Heh, thanks for the comment. I'd rather not mod on these forums though. _________________
- Retired. |
|
| Back to top |
|
 |
Golden Wing Grandmaster Cheater
Reputation: 0
Joined: 29 Aug 2007 Posts: 905
|
Posted: Thu Nov 08, 2007 10:11 pm Post subject: |
|
|
| yea wiccaan give me a better one and is better at programming |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Thu Nov 08, 2007 10:17 pm Post subject: |
|
|
| xDemonRobbiex wrote: | | yea wiccaan give me a better one and is better at programming |
I'm not trying to be the better of anyone here. Just trying to point out improper coding to prevent others from learning wrong things. _________________
- Retired. |
|
| Back to top |
|
 |
XxOsirisxX Grandmaster Cheater Supreme
Reputation: 0
Joined: 30 Oct 2006 Posts: 1597
|
Posted: Thu Nov 08, 2007 10:22 pm Post subject: |
|
|
| Wiccaan wrote: | | XxOsirisxX wrote: | | I have more knowledge than you, that is sure. I never give all the options in 1 answer, i just post the answer of multi-actions in 1 button. |
Funny how your response to anyone that corrects you is an insult. Typically for you it's "i know more then you". Sadly, this is not the case. You are trying to give an example with shit code that is just plain wrong. I'm not one to judge people for somewhat crap code that could be done better, but yours is just plain wrong.
| XxOsirisxX wrote: | | Also, i take the actions by the example that he make. The random is pretty easy on VB if that where the case. I never read where he says "random" he says, 1 button multiples dmgs and looking for the example, i just think in that. |
| xDemonRobbiex wrote: | | and now like if they wanna use the attack again it will hit different and the label will change |
That would imply he wants it to randomly select a damage amount. He may have not said it directly, but thats what he ment.
I supplied him with working code, he said it worked and it was what he wanted. What was the point for you to add your code in here anyway?
I'm not trying to attack you but you seem to think you are the ruler of the world and when someone tries to help you learn from your mistakes, you blow up and act like god. Admit you're wrong, go back and read up on the language, and go on with things.
| Jaetoo wrote: | | LOL. Wiccan should be the General Programming Mod. He's hella good at everything. |
Heh, thanks for the comment. I'd rather not mod on these forums though. |
Meh, w.e, i did post what i trough he wanted, i did'nt, and i would'nt download what you posted, since i don't need it and i really don't care about it.
Anyhow, i'm sure you did make an "ego-up" post before, and that was my reaction post about it. " you really don't know VB".. not an attack? o well, it was directly. If you did get what he means, and did his request, then there are no reason of BS post, counting mines, the point of this is not about who knows more, is about help. If you think about it difference or anything else.. post.  _________________
|
|
| Back to top |
|
 |
|