Inside3D!
     

Sniper rifle tutorial - some error!

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
KOLIAN_bel



Joined: 24 Mar 2007
Posts: 12
Location: BELARUS

PostPosted: Sun Mar 25, 2007 8:36 am    Post subject: Sniper rifle tutorial - some error! Reply with quote

http://inside3d.com/showtutorial.php?id=69
Here i read an a tutorial and try to do it.
But when i start compile this code , compiler writes:
Unknow function "else" in this code:
else if (self.impulse == 3)
{
if (self.weapon != IT_SUPER_SHOTGUN)
{
fl = IT_SUPER_SHOTGUN;
if (self.ammo_shells < 2)
am = 1;
}
else
{
fl = IT_SNIPER;
if (self.ammo_shells < 10)
am = 1;
}
}

Can someone help me? Crying or Very sad


Last edited by KOLIAN_bel on Sun Mar 25, 2007 6:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
Lardarse



Joined: 05 Nov 2005
Posts: 243
Location: Bristol, UK

PostPosted: Sun Mar 25, 2007 4:36 pm    Post subject: Reply with quote

It needs to be else and not ELSE
Back to top
View user's profile Send private message
KOLIAN_bel



Joined: 24 Mar 2007
Posts: 12
Location: BELARUS

PostPosted: Sun Mar 25, 2007 6:46 pm    Post subject: Reply with quote

I wrote ELSE big, because it must to be a big - that you notice it
Back to top
View user's profile Send private message
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Sun Mar 25, 2007 10:31 pm    Post subject: Reply with quote

Can you paste the lines above and below where you copy pasted that?

'else if' blocks have to follow an 'if' block.

For example:

Code:
if
{
    ...
}
else if
{
    ...
}


is good.

Code:
else if
{
    ...
}
if
{
    ...
}


is bad.
_________________
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Back to top
View user's profile Send private message
KOLIAN_bel



Joined: 24 Mar 2007
Posts: 12
Location: BELARUS

PostPosted: Mon Mar 26, 2007 12:37 pm    Post subject: Reply with quote

sounds good! Very Happy
I try that...
Thanks Cool
Back to top
View user's profile Send private message
KOLIAN_bel



Joined: 24 Mar 2007
Posts: 12
Location: BELARUS

PostPosted: Tue Mar 27, 2007 1:59 pm    Post subject: Reply with quote

I am understand!
There must be another one {
in the end!
Men that writing this don't was very attenitively Laughing
Back to top
View user's profile Send private message
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Tue Mar 27, 2007 2:06 pm    Post subject: Reply with quote

Ha! Indeed! Very Happy

That {, she can be a cruel handmaiden Laughing
_________________
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group