View previous topic :: View next topic |
Author |
Message |
KOLIAN_bel
Joined: 24 Mar 2007 Posts: 12 Location: BELARUS
|
Posted: Sun Mar 25, 2007 8:36 am Post subject: Sniper rifle tutorial - some error! |
|
|
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? 
Last edited by KOLIAN_bel on Sun Mar 25, 2007 6:47 pm; edited 1 time in total |
|
Back to top |
|
 |
Lardarse

Joined: 05 Nov 2005 Posts: 243 Location: Bristol, UK
|
Posted: Sun Mar 25, 2007 4:36 pm Post subject: |
|
|
It needs to be else and not ELSE |
|
Back to top |
|
 |
KOLIAN_bel
Joined: 24 Mar 2007 Posts: 12 Location: BELARUS
|
Posted: Sun Mar 25, 2007 6:46 pm Post subject: |
|
|
I wrote ELSE big, because it must to be a big - that you notice it |
|
Back to top |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Sun Mar 25, 2007 10:31 pm Post subject: |
|
|
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 |
|
 |
KOLIAN_bel
Joined: 24 Mar 2007 Posts: 12 Location: BELARUS
|
Posted: Mon Mar 26, 2007 12:37 pm Post subject: |
|
|
sounds good!
I try that...
Thanks  |
|
Back to top |
|
 |
KOLIAN_bel
Joined: 24 Mar 2007 Posts: 12 Location: BELARUS
|
Posted: Tue Mar 27, 2007 1:59 pm Post subject: |
|
|
I am understand!
There must be another one {
in the end!
Men that writing this don't was very attenitively  |
|
Back to top |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Tue Mar 27, 2007 2:06 pm Post subject: |
|
|
Ha! Indeed!
That {, she can be a cruel handmaiden  _________________ 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 |
|
 |
|