Forum

Sniper rifle tutorial - some error!

Discuss anything not covered by any of the other categories.

Moderator: InsideQC Admins

Sniper rifle tutorial - some error!

Postby KOLIAN_bel » Sun Mar 25, 2007 8:36 am

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? :cry:
Last edited by KOLIAN_bel on Sun Mar 25, 2007 6:47 pm, edited 1 time in total.
KOLIAN_bel
 
Posts: 12
Joined: Sat Mar 24, 2007 8:34 pm
Location: BELARUS

Postby Lardarse » Sun Mar 25, 2007 4:36 pm

It needs to be else and not ELSE
User avatar
Lardarse
 
Posts: 266
Joined: Sat Nov 05, 2005 1:58 pm
Location: Bristol, UK

Postby KOLIAN_bel » Sun Mar 25, 2007 6:46 pm

I wrote ELSE big, because it must to be a big - that you notice it
KOLIAN_bel
 
Posts: 12
Joined: Sat Mar 24, 2007 8:34 pm
Location: BELARUS

Postby Sajt » Sun Mar 25, 2007 10:31 pm

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: Select all
if
{
    ...
}
else if
{
    ...
}


is good.

Code: Select all
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.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby KOLIAN_bel » Mon Mar 26, 2007 12:37 pm

sounds good! :D
I try that...
Thanks 8)
KOLIAN_bel
 
Posts: 12
Joined: Sat Mar 24, 2007 8:34 pm
Location: BELARUS

Postby KOLIAN_bel » Tue Mar 27, 2007 1:59 pm

I am understand!
There must be another one {
in the end!
Men that writing this don't was very attenitively :lol:
KOLIAN_bel
 
Posts: 12
Joined: Sat Mar 24, 2007 8:34 pm
Location: BELARUS

Postby Sajt » Tue Mar 27, 2007 2:06 pm

Ha! Indeed! :D

That {, she can be a cruel handmaiden :lol:
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.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest