-
September 5th, 2009, 01:10 AM
#31
Re: Save game/Load game
Originally Posted by dglienna
You can Shell() a program to open it.
Code:
Shell("C:\temp\notepad.exe")
ok thanx
Now I have made my game, but I have made an code system. For example you can buy with real money some money to the game.
Here is the code:
If Text1.Text = 489331 Then
Label1 = Val(Label1) + 5000
Else
If Text1.Text = 123456 Then
Label1 = Val(Label1) + 500000
Else
MsgBox "Wrong code"
End If
End If
But I need to get it so that you only can use the code 489331 once. Otherwise you can press the "Submit" button 100000000 times and get a lot of money.
Anyone?
-
September 5th, 2009, 01:31 AM
#32
Re: Save game/Load game
Use a FLAG, initialize it somewhere else
Code:
Dim Flag1 as Boolean
Flag1=False
Code:
if Flag1=false then
If Text1.Text = 489331 Then
Flag1=True
Label1 = Val(Label1) + 5000
End If
End If
this will only fire the first time. that's how you use a flag
-
September 5th, 2009, 01:43 AM
#33
Re: Save game/Load game
Originally Posted by dglienna
Use a FLAG, initialize it somewhere else
Code:
Dim Flag1 as Boolean
Flag1=False
Code:
if Flag1=false then
If Text1.Text = 489331 Then
Flag1=True
Label1 = Val(Label1) + 5000
End If
End If
this will only fire the first time. that's how you use a flag
Dosen't work.
I can press the "Submit" button how many times I whant ansd there is still coming money
-
September 5th, 2009, 09:37 PM
#34
Re: Save game/Load game
Not quite right:
Code:
Flag1=False
Sub ...
Static Flag1 as Boolean ' stays the same, starts at false
if Flag1=false then
If Text1.Text = 489331 Then
Flag1=True
Label1 = Val(Label1) + 5000
End If
End If
End Sub
-
September 7th, 2009, 07:55 AM
#35
Re: Save game/Load game
This is not as trivial as you might think.
If you restart the program the flag is reset again. You can repeatedly start the program and press the submit button once again.
There must be a more complex mechanism to make sure, a code is only used once, if you want to be sure.
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
|