skaryChinezeGuie
Well-known member
- Joined
- Apr 23, 2006
- Messages
- 94
- Programming Experience
- Beginner
I was trying to make the prices change at random between certain ranges every time the location changes. here's what i did.
public variables:
Public NewLocation As String
Public LocOkolona As String = "Okolona"
Public LocBuechel As String = "Buechel"
Public LocFernCreek As String = "Fern Creek"
Public LocPRP As String = "PRP"
Public LocStMatthews As String = "St. Matthews"
Public LocJtown As String = "J-Town"
Public LocFairdale As String = "Fairdale"
Public LocValleyStation As String = "Valley Station"
Public LocMiddleTown As String = "Middletown"
Public LocPortland As String = "Portland"
Public randomObject As Random = New Random
Public acidPrice = randomObject.Next(1000, 4500)
Public cocainePrice = randomObject.Next(15000, 29000)
Public PcpPrice = randomObject.Next(1000, 4500)
Public HeroinPrice = randomObject.Next(5000, 18000)
Public ecstasyPrice = randomObject.Next(15, 55)
Public weedPrice = randomObject.Next(300, 1000)
Public hashPrice = randomObject.Next(5000, 10000)
Public speedPrice = randomObject.Next(75, 200)
Public shroomsPrice = randomObject.Next(600, 1200)
main form:
Private Sub BtnMap_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnMap.Click
Dim nFrmMap As Form = New FrmMap
nFrmMap.ShowDialog()
LblPlace.Text = NewLocation
TxtPriceAcid.Text = acidPrice
TxtPriceCocaine.Text = cocainePrice
TxtPriceEcstasy.Text = ecstasyPrice
TxtPricePCP.Text = PcpPrice
TxtPriceHeroin.Text = HeroinPrice
TxtPriceWeed.Text = weedPrice
TxtPriceShrooms.Text = shroomsPrice
TxtPriceSpeed.Text = speedPrice
TxtPriceHash.Text = hashPrice
but it only works once. it does seem to work though.
Thanks in advance.
public variables:
Public NewLocation As String
Public LocOkolona As String = "Okolona"
Public LocBuechel As String = "Buechel"
Public LocFernCreek As String = "Fern Creek"
Public LocPRP As String = "PRP"
Public LocStMatthews As String = "St. Matthews"
Public LocJtown As String = "J-Town"
Public LocFairdale As String = "Fairdale"
Public LocValleyStation As String = "Valley Station"
Public LocMiddleTown As String = "Middletown"
Public LocPortland As String = "Portland"
Public randomObject As Random = New Random
Public acidPrice = randomObject.Next(1000, 4500)
Public cocainePrice = randomObject.Next(15000, 29000)
Public PcpPrice = randomObject.Next(1000, 4500)
Public HeroinPrice = randomObject.Next(5000, 18000)
Public ecstasyPrice = randomObject.Next(15, 55)
Public weedPrice = randomObject.Next(300, 1000)
Public hashPrice = randomObject.Next(5000, 10000)
Public speedPrice = randomObject.Next(75, 200)
Public shroomsPrice = randomObject.Next(600, 1200)
main form:
Private Sub BtnMap_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnMap.Click
Dim nFrmMap As Form = New FrmMap
nFrmMap.ShowDialog()
LblPlace.Text = NewLocation
TxtPriceAcid.Text = acidPrice
TxtPriceCocaine.Text = cocainePrice
TxtPriceEcstasy.Text = ecstasyPrice
TxtPricePCP.Text = PcpPrice
TxtPriceHeroin.Text = HeroinPrice
TxtPriceWeed.Text = weedPrice
TxtPriceShrooms.Text = shroomsPrice
TxtPriceSpeed.Text = speedPrice
TxtPriceHash.Text = hashPrice
but it only works once. it does seem to work though.
Thanks in advance.