08-24-2012, 12:47 PM
Whenever you work with player objects, as you do with your addAction and such, you need to make sure the variable is assigned the proper value when in a dedicated environment. Also some commands in ArmA can only be used when the game is running (time > 0).
So to fix future problem 1's, add this to the top of the script:
waitUntil { !(isNull player) };
waitUntil { time > 0 };
You really should read up on MP scripting and JIP on the biki if you want scripts to work in a dedi env.
For problem 2, like wolf said, welcome to ArmA scripting. When I create stuff I usually run stuff line by line in my debugger to see what works and what doesn't in that situation, and all the stuff that works gets pasted in a file. It's not very common that you can just script an entire file without doublechecking the effects of every line of code in a debugger.
So to fix future problem 1's, add this to the top of the script:
waitUntil { !(isNull player) };
waitUntil { time > 0 };
You really should read up on MP scripting and JIP on the biki if you want scripts to work in a dedi env.
For problem 2, like wolf said, welcome to ArmA scripting. When I create stuff I usually run stuff line by line in my debugger to see what works and what doesn't in that situation, and all the stuff that works gets pasted in a file. It's not very common that you can just script an entire file without doublechecking the effects of every line of code in a debugger.