Zelaron Gaming Forum  
Stats Arcade Portal Forum FAQ Community Calendar Today's Posts Search
Go Back   Zelaron Gaming Forum > The Zelaron Nexus > Science and Art > Tech Help

 
 
Thread Tools Display Modes

 
Its not showing
Reply
Posted 2004-08-11, 04:57 PM
I have a button on one form that is the "buy" button. When someone clicks it it gives them a inputbox asking how many grams of heroin they want to buy , When they click this it finds out if they have enough money at first. Then if they do it subtracts how much it cost from there money and adds however many they wanted to the heroin variable (showing how many they have in there inventory) but when i go to the inventory it wont show up. But when you buy some buds it shows up. here it the buy button code:

Private Sub Command15_Click()
' buying heroin
buy = InputBox("How many do you want to buy", "How many?")
If buy * dheroin < cash Then
MsgBox ("You just bought " & buy & " grams of heroin")
final = buy * dheroin
cash = cash - final
heroin = heroin + buy
Else
MsgBox ("You dont have enough money")
End If
End Sub

Dheroin is how much the heroin costs. buy is the number the user wants to buy. final is how many they want to buy times how much it costs. cash is there current money, and heroin is the variable that stores how much heroin the user has.

On another form, the inventory page, it shows how much of each drug the user has and I have it set up so it will update the label that shows how much for heroin you have by setting the interaval on timer to 5. and when the 5 is up it just sets itself back to 5.

here is the timer script:

heroin1.Caption = heroin

heroin1 is the label.


Are you suggesting coconuts migrate?
Old
Profile PM WWW Search
Arbitus is neither ape nor machine; has so far settled for the in-betweenArbitus is neither ape nor machine; has so far settled for the in-between
 
 
Arbitus
 



 
Reply
Posted 2004-08-11, 06:52 PM in reply to Arbitus's post "Its not showing"
Hmm, is Heroin declared as a Public value? If not, you'll just get 0 every time. (And if it is, I'd say to make sure you didn't declare it as "Herion" or something by accident.)

Also, I'd really, REALLY recommend actually naming your command buttons to something useful, like cmdBuyHeroin. I cannot imagine attempting to figure out which command button is which using the code.

Edit: Also, why dHeroin instead of heroinCost or something?
Old
Profile PM WWW Search
BlueCube enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHzBlueCube enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHz
 
 
BlueCube
 



 
Reply
Posted 2004-08-11, 10:32 PM in reply to BlueCube's post starting "Hmm, is Heroin declared as a Public..."
LOL I know my scripts are sloppy, they ussually arint. This whole game started as a joke but im having fun doing this so I decided to make it pretty big. Thanks for the help I will check it out some more.

EDIT: FIXED. alright here is what was wrong. I had a public variable called heroin and the name of one of the labels was heroin. so it was setting the label to "Buys" anyways THANKS!


Are you suggesting coconuts migrate?

Last edited by Arbitus; 2004-08-12 at 02:02 AM.
Old
Profile PM WWW Search
Arbitus is neither ape nor machine; has so far settled for the in-betweenArbitus is neither ape nor machine; has so far settled for the in-between
 
 
Arbitus
 
 

Bookmarks

« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules [Forum Rules]
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 09:46 AM.
'Synthesis 2' vBulletin 3.x styles and 'x79' derivative
by WetWired the Unbound and Chruser
Copyright ©2002-2008 zelaron.com
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.