Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Dbpro, Input text shows then instantly deletes

Author
Message
Trev
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Canada, Ontario
Posted: 2nd May 2004 18:33 Edited at: 2nd May 2004 18:37
This is the code i'm using

rem shop (ammunition)
if cx#>180 and cx#<230 and cz#>300 and cz#<325 and shop=0
print "Press Z to talk to shop keeper"
shop=1
endif

if (inkey$())="z" and shop=1
print "bullets are 2 for a daller and work in all guns. press b tobuy"
endif

if (inkey$())="b" and shop=1
input "this text wont show",bullets
if bullets*2=<money
money=money-bullets*2
ammo=ammo+bullets
shop=2
else
error=1
endif
endif
if cx#>180 and cx#<230 and cz#>300 and cz#<325 and shop=2
print "thank you come again"
else
shop=0
endif

if error=1 and cx#>180 and cx#<230 and cz#>300 and cz#<325
print "Sorry you can't afford that"
else
error=0
endif

this is also on 3d background(not sure if it matters). All the rest of the code works fine including the part were it gets the bullets just wont print the text.

Trevor Somerville
Cypher Hax0r
20
Years of Service
User Offline
Joined: 16th Dec 2003
Location: Toilet
Posted: 2nd May 2004 19:36
use wait key then itll wait for the player to press another button before it deletes it
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd May 2004 20:42
The screen will get cleared each time your program does a sync, because you are using a 3D background. If you want the text to stay, you'll need to continually redisplay it yourself.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
Jobyman
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location:
Posted: 2nd May 2004 21:06


you can change this to


and then instead of having


change it to


in your code the input text would only show if the b key is pressed and thats kinda inconvenient. Now it shows when you want to buy bullets. and remember to reset the variables: shop and buy_bullet to 0 after the player makes a purchase.

Everyone is a comedian...
Trev
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Canada, Ontario
Posted: 2nd May 2004 22:05
thx jobyman and the rest of you for ur help i got it working now thx.

Trevor Somerville

Login to post a reply

Server time is: 2024-09-22 08:52:13
Your offset time is: 2024-09-22 08:52:13