Function freezing

Posted By: Chameleon_Man

Function freezing - 05/03/06 05:43

Hey guys,

Okay, I understand from using C-Script that the code is read top to bottom, and when a function is read, it initiates the function while continuing to read the code. How do I do it so that when it gets to the function, it stops and goes through the function, and at the end of the function it continues on its path? I'm used to simple command-line C++, so C-Script somewhat confuses me. Thanks a ton guys.

-Harb
Posted By: Michael_Schwarz

Re: Function freezing - 05/03/06 05:47

Lets just suppose i didnt read the sentence "and at the end of the function it continues on its path? " because it makes absolutely no sense.

Lets just suppose I just read your thread title, then while loops are what you are looking for:

var somevariable;

function dosomething
{
while(1){
while(somevariable){wait(1);}
//add some stuff here
wait(1);
}
}

you just have to set var somevariable to 1 to freeze the function.
© 2024 lite-C Forums