09.10.2010, 22:29
i had a idea of detecting a bullets path, and creating icons in its path, but i really have no clue on how i would do it, so if anyone has any ideas, tell me
With icons, you mean mapicons, objects, or pickups?
You will have to use the OnPlayerKeyStateChange callback to detect when someone presses the left click (that is, when he shot) and check the weapon he is currently carrying (you don't want to make trails if he is punching or throwing a grenade). After that, you need to use the GetPlayerCameraFrontVector function, which will give you a player-relative position of where the player is aiming. You add several multipliers to the values gotten, sum the player's position to it, and create an object/pickup/mapicon. Try to do it, if you get stuck or need further insight in this last part don't hesitate to ask. |