24.10.2011, 14:07
Well the code looks fine to me, although there is a redundant check, why check if someone is in a vehicle AND if they are the driver? Just check if someone is the driver and then they must be in a vehicle to be the driver ![Smiley](images/smilies/smile.png)
As for why it's not working, I'm not sure really, unless I'm missing something it looks like it would work to me. Although the way you are checking which key is being pressed, you need to make sure you are not pressing any other keys when you press KEY_FIRE, otherwise it will not work. Maybe you were pressing other keys when you tried to detatch it?
![Smiley](images/smilies/smile.png)
As for why it's not working, I'm not sure really, unless I'm missing something it looks like it would work to me. Although the way you are checking which key is being pressed, you need to make sure you are not pressing any other keys when you press KEY_FIRE, otherwise it will not work. Maybe you were pressing other keys when you tried to detatch it?