i found out that it is not the function itself that is causing the crash, but one of the turret structs that has more than one weapon assinged to it that is causing an e1513 error. But this is now my job and not yours.
I will look through my complete code and try to find the error by myself and stop wasting your time. Thank you very much, you brought me a very large step forward in my project. Good night.

Regards