It crashes always in the same place of the other function when the other function is called.
The function with the for(;;) was a physics function for the game play and the other one had something to do with menu. The other function crashes even without the use of the function with for(;;), the only thing that matters is that function with for(;;) exists in the script.
One other interesting hint is that i have actually 2 functions that do not work properly, the function which is written down in the overallscript first will crash when called. Both have a similar structure:
function dosomething(STRUCT* struct)
{
for(this and that)
{
some code here
while(dll_function()==0)//functions crash here
{
wait(1);
}
some code here
}
}