satoon101 wrote:I would say whatever you choose works best for you. Again, these guidelines are specific to the plugin itself and not for everyone's scripts.
That's kinda what I figured. Thanks for clearing up.
satoon101 wrote:When we first started this plugin, we had thought that many people might post some good additions to the plugin itself. Since we wanted to keep everything fairly uniform, and so that we didn't have to go back through anyone's code, we decided to post this thread for them to reference. Then, if we had any issues with the formatting of the code, we could just post a link to this thread so they could update it to our standards. Unfortunately, very little was posted and what was didn't really fit with our gameplan for the specific areas that were involved. This thread still serves that purpose for anyone who does post code, either here or as a pull request on GitHub.
I think, as the plugin and its recognition grows, this thread will gain attention, too.
satoon101 wrote:Back to your post specifically. It is my intention that the next commit I make will include both m_flFlashMaxAlpha and m_flFlashDuration in the entities data.
The flashbang count (m_iAmmo.012) is already available:
Syntax: Select all
count = <PlayerEntity>.get_flashbang_count()
I am not sure about m_iPlayerState. I will have to look more into that property to see how we want to account for it.
Okay, I didn't notice set/get_flashbang_count was available.
Ayuto wrote:I would also like to add that using constants will make your life easier in some situations.
1. If the value of the constant need to be changed, you only need to change one occurence. If you don't use constants you would need to do that everywhere you use this value.
2. Constants also allow you to give values a name. Imagine you use the value "5" somewhere in your code. At the first glance you won't know what the value is representing. If you would create a constant for it (e.g. PLAYER_SPEED) it would be absolutely clear what the value represents.
You're right. Is it better to use #2 or #3? What would you say? =)