|
|
|
|
functions
#229497
09/28/08 00:38
09/28/08 00:38
|
Joined: Aug 2008
Posts: 408 mi usa
sadsack
OP
Senior Member
|
OP
Senior Member
Joined: Aug 2008
Posts: 408
mi usa
|
hello, Can some one tell me why this function is not working. This is very simple code.
#include <acknex.h>; //You need these includes at the start of your main script.
#include <default.c>;
//////////////////////////////declared function/////////////////////////////////////////////////////////////
function one();
function main()
{
//This section happens once when the function is run initially
level_load("");
wait(3); //Wait required for level load
}
////////////////////////////////calling the function//////////////////////////////////////////////////////
while(1)
{
//This section happens every frame due to a while loop.
one();
}
wait(1);
/////////// function////////////////////////////////////////////////////////////////////////////////
function one()
{
{sys_exit("bye bye...");}
}
Thank you renny
I have A7 Commercial .............. Now I just need to learn how to use it
|
|
|
Re: functions
[Re: sadsack]
#229533
09/28/08 12:50
09/28/08 12:50
|
Joined: Aug 2008
Posts: 218 U.S.
GamerX
Member
|
Member
Joined: Aug 2008
Posts: 218
U.S.
|
#include <acknex.h>; //You need these includes at the start of your main script.
#include <default.c>;
//////////////////////////////declared function/////////////////////////////////////////////////////////////
function one();
function main()
{
//This section happens once when the function is run initially
level_load("");
wait(3); //Wait required for level load
one();
}
/////////// function////////////////////////////////////////////////////////////////////////////////
function one()
{
sys_exit("bye bye...");
}
You don't need a while loop unless you intend on calling it more than one time and in this case you can't.
"You may never know what results come of your action, but if you do nothing there will be no result." -Mahatma Gandhi
|
|
|
Re: functions
[Re: GamerX]
#229548
09/28/08 14:58
09/28/08 14:58
|
Joined: Aug 2008
Posts: 408 mi usa
sadsack
OP
Senior Member
|
OP
Senior Member
Joined: Aug 2008
Posts: 408
mi usa
|
Why does this function does not work in the while loop. I plan on having more than one function. Thank You renny
I have A7 Commercial .............. Now I just need to learn how to use it
|
|
|
Re: functions
[Re: sadsack]
#229551
09/28/08 15:15
09/28/08 15:15
|
Joined: Aug 2008
Posts: 218 U.S.
GamerX
Member
|
Member
Joined: Aug 2008
Posts: 218
U.S.
|
You can put it in a while loop if you want just make sure the loop is in a function like in this case in the main function
#include <acknex.h>;
#include <default.c>;
//////////////////////////////declared function/////////////////////////////////////////////////////////////
function one();
function main()
{
//This section happens once when the function is run initially
level_load("");
wait(3); //Wait required for level load
while(1)
{
//This section happens every frame due to a while loop.
one();
wait(1);
}
}
/////////// function////////////////////////////////////////////////////////////////////////////////
function one()
{
sys_exit("bye bye...");
}
See? Need it in a function or its just sitting there doing nothing.
"You may never know what results come of your action, but if you do nothing there will be no result." -Mahatma Gandhi
|
|
|
Re: functions
[Re: GamerX]
#229565
09/28/08 16:56
09/28/08 16:56
|
Joined: Aug 2008
Posts: 408 mi usa
sadsack
OP
Senior Member
|
OP
Senior Member
Joined: Aug 2008
Posts: 408
mi usa
|
Thank you GamerX I could not think why that would not work, But thanks to you I see how importance {} are now. Thanks renny
I have A7 Commercial .............. Now I just need to learn how to use it
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|
|
|
|