30.11.2010, 22:21
I honestly do not feel like writing new code, or even looking at it, so I'll give you what is a better approach than "hanging" your server:
- Make a variable to store the vehicle's lights status
- Run a 1 second timer checking the variable. If the lights are one, set them off, and vice-verse.
A one second timer would be fine for this situation. The problem with your code is it was re-setting the lights on/off multiple times a second, so you probably couldn't notice the differences. I'm also sure there are other ways for doing this, more efficiently, but like I said, not in the mood.
- Make a variable to store the vehicle's lights status
- Run a 1 second timer checking the variable. If the lights are one, set them off, and vice-verse.
A one second timer would be fine for this situation. The problem with your code is it was re-setting the lights on/off multiple times a second, so you probably couldn't notice the differences. I'm also sure there are other ways for doing this, more efficiently, but like I said, not in the mood.