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 / Please help me with this code!

Author
Message
Kenomica_deleted
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 30th Jul 2004 03:12
ive been working on this for a while now, it keeps saying Could not close nest at *line number* and i cant find any mistakes, please help me

Kirt

Newbie Brogo
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: In a Pool of Cats
Posted: 30th Jul 2004 03:30
You forgot to end one of your if statements:

Quote: "
if nHandgun = 0
print "You Hear a Noise"
wait key
play sound 1
print "You Feel a Sharp Pain in your chest!"
play sound 2
gameover = 1
else
if nRedKey = 0
print "You Hear a Noise"
wait key
play sound 1
wait key
print "You Aim Your Handgun and...."
wait key
print "BANG!!"
wait key
print "You hear the shot richochet off the wall"
wait key
print "You Missed...."
wait key
print "You Turn on your torch, yet you see nothing"
wait key
print "a sharp pain enters your lower back, you feel cold"
print "and collapse to the ground....."
wait key
print "you wake up in a pool of your own blood, you look around"
wait key
print "You are outside of the Factory!"
print "you pick up an ornate looking key from the floor,"
nOrnateKey = 1
wait key
gosub EnterFactory
else
print "Back in the Darkness,"
wait key
print "You notice a small red keyhole in the floor"
wait key
print "You use the Blood Red Key!"
endif
(add an endif right here)
"


You want a second endif after that one at the end. You see, you opened up one if statement and then opened another in the else, so you must end them both, I've tested and it runs, with the second endif.

Kenomica_deleted
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 30th Jul 2004 05:18
oh thanx your a life saver , am still learnin u see lol
thnx sooo much

demons breath
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 2nd Aug 2004 01:20
if you indent your code, then you won't make these sorts of mistakes so easily - you will be able to see if something doesn't match up because there will be too many indentations at one point for example.

Am I the only one here who's really confused?
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 2nd Aug 2004 02:26 Edited at: 2nd Aug 2004 02:27
something like this...




DBP_NETLIB_v1.4.3 - 65 FREE Functions * Click Logo

Login to post a reply

Server time is: 2024-11-27 04:34:41
Your offset time is: 2024-11-27 04:34:41