X5KillerKlownzX
Junior Member
Posts: 6
Threads: 2
Joined: Apr 2013
Reputation:
0
|
Expected '('
I need some help with scripting! im trying to make the end, but I get this error that says main(3,1) : ERR : Expected '('
My script is this:
void OnLeave
void ending(string &in asTimer)
{
StartCredits("ending_alexander.ogg", false, "Ending", "MainCredits", 9001);
}
|
|
04-15-2013, 10:14 PM |
|
WALP
Posting Freak
Posts: 1,221
Threads: 34
Joined: Aug 2012
Reputation:
45
|
RE: Expected '('
Is it not supposed to be void OnLeave()?
|
|
04-16-2013, 12:37 AM |
|
7heDubz
Posting Freak
Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation:
41
|
RE: Expected '('
(04-16-2013, 12:37 AM)martinnord Wrote: Is it not supposed to be void OnLeave()?
Yes. Thats you problem. Good luck
|
|
04-16-2013, 12:48 AM |
|
X5KillerKlownzX
Junior Member
Posts: 6
Threads: 2
Joined: Apr 2013
Reputation:
0
|
RE: Expected '('
(04-16-2013, 12:48 AM)WIWWM Wrote: (04-16-2013, 12:37 AM)martinnord Wrote: Is it not supposed to be void OnLeave()?
Yes. Thats you problem. Good luck
Thanks! I will send a reply with a link of the map when im finished... I am new to this
(04-16-2013, 12:48 AM)WIWWM Wrote: (04-16-2013, 12:37 AM)martinnord Wrote: Is it not supposed to be void OnLeave()?
Yes. Thats you problem. Good luck
Im still having problems with the code. The code is now this:
void OnLeave()
void ending(string &in asTimer);
{
StartCredits("ending_alexander.ogg", false, "Ending", "MainCredits", 9001);
}
|
|
04-16-2013, 01:50 AM |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
RE: Expected '('
(04-16-2013, 01:50 AM)X5KillerKlownzX Wrote: (04-16-2013, 12:48 AM)WIWWM Wrote: (04-16-2013, 12:37 AM)martinnord Wrote: Is it not supposed to be void OnLeave()?
Yes. Thats you problem. Good luck
Thanks! I will send a reply with a link of the map when im finished... I am new to this
(04-16-2013, 12:48 AM)WIWWM Wrote: (04-16-2013, 12:37 AM)martinnord Wrote: Is it not supposed to be void OnLeave()?
Yes. Thats you problem. Good luck
Im still having problems with the code. The code is now this:
void OnLeave()
void ending(string &in asTimer);
{
StartCredits("ending_alexander.ogg", false, "Ending", "MainCredits", 9001);
} It's
void OnLeave
{
}
"Veni, vidi, vici."
"I came, I saw, I conquered."
|
|
04-16-2013, 06:17 AM |
|
Som1Lse
Member
Posts: 183
Threads: 9
Joined: Sep 2010
Reputation:
0
|
RE: Expected '('
(04-16-2013, 06:17 AM)JustAnotherPlayer Wrote: It's
void OnLeave
{
} Actually it is:
void OnLeave()
{
//code here
}
Also there should not be a semicolon after the ending function:
void ending(string &in asTimer);
So final code would look like:
void OnLeave()
{
//code here
}
void ending(string &in asTimer)
{
StartCredits("ending_alexander.ogg", false, "Ending", "MainCredits", 9001);
}
I highly recommend indenting lines withing functions and if statements as shown above as it can make your code way easier to read, and keep track of.
(This post was last modified: 04-16-2013, 08:42 AM by Som1Lse.)
|
|
04-16-2013, 08:41 AM |
|
Traggey
is mildly amused
Posts: 3,257
Threads: 74
Joined: Feb 2012
Reputation:
185
|
RE: Expected '('
Moved thread to development support.
|
|
04-16-2013, 09:24 AM |
|
X5KillerKlownzX
Junior Member
Posts: 6
Threads: 2
Joined: Apr 2013
Reputation:
0
|
RE: Expected '('
(04-16-2013, 08:41 AM)Someone else Wrote: (04-16-2013, 06:17 AM)JustAnotherPlayer Wrote: It's
void OnLeave
{
} Actually it is:
void OnLeave()
{
//code here
}
Also there should not be a semicolon after the ending function:
void ending(string &in asTimer);
So final code would look like:
void OnLeave()
{
//code here
}
void ending(string &in asTimer)
{
StartCredits("ending_alexander.ogg", false, "Ending", "MainCredits", 9001);
}
I highly recommend indenting lines withing functions and if statements as shown above as it can make your code way easier to read, and keep track of.
Yes. I will do that, but i copied that code, and removed the //code here cause i didnt have a code there. I am still getting an error but it is a different one. Now it is something like, "main (8,2) : ERR : Unexpected token '{' " I will send the code.
void OnLeave()
{
}
void ending(string &in asTimer);
{
StartCredits("ending_alexander.ogg", false, "Ending", "MainCredits", 9001); This goes with StartCredits
}
Thats my code... Plz tell me what I done wrong.
|
|
04-16-2013, 12:04 PM |
|
Adrianis
Senior Member
Posts: 620
Threads: 6
Joined: Feb 2012
Reputation:
27
|
RE: Expected '('
Same as one of the problems you had before
void ending(string &in asTimer);
{
StartCredits("ending_alexander.ogg", false, "Ending", "MainCredits", 9001); This goes with StartCredits
}
You need to not have a ; after void ending
Also, when you want to have normal writing in the code as a comment, you need to use // so that the program knows that the writing is not to be run as part of the script
void ending(string &in asTimer)
{
StartCredits("ending_alexander.ogg", false, "Ending", "MainCredits", 9001); //This goes with StartCredits
}
Be careful to read all of what people say when they are trying to help you, the previous commenter Someone Else already pointed out the first issue
(This post was last modified: 04-16-2013, 12:37 PM by Adrianis.)
|
|
04-16-2013, 12:36 PM |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
RE: Expected '('
Did you even add a timer?
"Veni, vidi, vici."
"I came, I saw, I conquered."
|
|
04-16-2013, 02:49 PM |
|
|