20.03.2011, 21:08
In short:
1. Create a minigun object (like the one in singleplayer)
2. Create a timer for it (Interval ~300-500ms should do it)
3. Create the timer function. In that function create a player loop: Check if there are planes/vehicles/players in any range you like (e.g. with IsPlayerInRangeOfPoint). Also check the team of the player. If there is a matching player, decrease his health/his vehicles' health and stop the loop (break) so it will only damage one player at a time. If you like, you could also rotate the object, so it will point in the players' direction, but this will require at least a little bit of math knowledge.
Congratulations! Now you got your own auto-shooting gun!
1. Create a minigun object (like the one in singleplayer)
2. Create a timer for it (Interval ~300-500ms should do it)
3. Create the timer function. In that function create a player loop: Check if there are planes/vehicles/players in any range you like (e.g. with IsPlayerInRangeOfPoint). Also check the team of the player. If there is a matching player, decrease his health/his vehicles' health and stop the loop (break) so it will only damage one player at a time. If you like, you could also rotate the object, so it will point in the players' direction, but this will require at least a little bit of math knowledge.
Congratulations! Now you got your own auto-shooting gun!
