AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   Show Teammates Armament (https://forums.alliedmods.net/showthread.php?t=336536)

EFFx 02-26-2022 21:21

Show Teammates Armament
 
2 Attachment(s)
Show Teammates Armament


Release: 02/27/2022
Last Update: 03/27/2022

- Description
- This plugins display the whole teammates armament, incluiding weapons, grenades, armor type and cash information during freezetime, a good touch to use in 5x5 servers.

- Cvars
se_show_weapons = Display all weapons icons
se_show_money = Display money icons
se_show_utilities = Display grenades/defuse and c4 icons
se_show_arrow = Display a little arrow over players head
se_show_armortype = Display armor type
se_show_arrow_only = Show always an arrow icon over all players (default 0).
se_show_arrow_only_mode = 0 Both team's arrow will be seen, 1 only your teammate's arrows and 2 the enemy team's arrow will be seen.

se_sprite_color_weapons = default yellow
se_sprite_color_money = default green
se_sprite_color_grenades = default white (tried each grenade color individually, no pattern and combinations looks good, so by default all of them are the same color)
se_sprite_color_vesthelm = default purple
se_sprite_color_kevlar = default pink
se_sprite_color_arrow = default yellow
se_sprite_color_c4 = default orange
se_sprite_color_defusekit = default green

- Gameplay Images

https://imgur.com/BaI6Kw0.png https://imgur.com/j60LLXo.png

- Credits
https://forums.alliedmods.net/showpo...01&postcount=4
https://forums.alliedmods.net/showpo...3&postcount=16

- Change log
Spoiler



Note: The sprites were tested with 32/32 podbots and nothing happened regarding crashes or lag with the sprites.

georgik57 03-02-2022 13:55

Re: Show Teammates Armament
 
will check test it out and review the code when i have time. looks great. thank you for sharing and congrats.

SoulWeaver16 03-02-2022 13:57

Re: Show Teammates Armament
 
Good plugin, I found that some of the sprites are floating instead of disappearing
And another thing would be, if you could add that the cvar of se_show_arrow, could remain the whole round and not only during freezetime
https://i.imgur.com/VQLfFyH.png

OciXCrom 03-02-2022 14:22

Re: Show Teammates Armament
 
Awesome plugin. I see this being widely used. So, here is some feedback:

-------------------------------------- [ 1 ] --------------------------------------

Code:
#define TASK_INV        4562 #define TASK_DISPLAY        4563 #define TASK_HIDE_ENTS      4564

This is a big 'no' and is likely the reason for the issue in the previous comment.
Unique task ids should have a difference of at least 32 between them - the maximum number of players.

I understand only the first one is being combined with player ids, but this will still cause issues. For example:

Player with id #1 has a TASK_INV of 4562+1=4563 which is equal to TASK_DISPLAY, player #2's task is equal to TASK_HIDE_ENTS, etc, so when interacting with the player's TASK_INV tasks, you can accidentally interact with one of the other tasks.

The simple solution:

Code:
enum (+= 32) {     TASK_INV = 4562,     TASK_DISPLAY,     TASK_HIDE_ENTS }

-------------------------------------- [ 2 ] --------------------------------------

Your plugin won't compile under 1.8.2 because MAX_PLAYERS is not defined.

Code:
#if !defined MAX_PLAYERS const MAX_PLAYERS = 32 #endif

-------------------------------------- [ 3 ] --------------------------------------

I don't see a code that removes the sprites when the player disconnects?

EFFx 03-02-2022 17:19

Re: Show Teammates Armament
 
Quote:

Originally Posted by SoulWeaver16 (Post 2772912)
Good plugin, I found that some of the sprites are floating instead of disappearing
And another thing would be, if you could add that the cvar of se_show_arrow, could remain the whole round and not only during freezetime
https://i.imgur.com/VQLfFyH.png

I wasn't getting that issue... well, I've changed the way it removes the sprites. Now one by one players gets their sprites removed so it doesn't call the function too many times in a single second. Also your request about the arrow always over players head is added, turn se_show_arrow_only 1.

Quote:

Originally Posted by OciXCrom (Post 2772919)
Awesome plugin. I see this being widely used. So, here is some feedback:

-------------------------------------- [ 1 ] --------------------------------------

Code:
#define TASK_INV        4562 #define TASK_DISPLAY        4563 #define TASK_HIDE_ENTS      4564

This is a big 'no' and is likely the reason for the issue in the previous comment.
Unique task ids should have a difference of at least 32 between them - the maximum number of players.

I understand only the first one is being combined with player ids, but this will still cause issues. For example:

Player with id #1 has a TASK_INV of 4562+1=4563 which is equal to TASK_DISPLAY, player #2's task is equal to TASK_HIDE_ENTS, etc, so when interacting with the player's TASK_INV tasks, you can accidentally interact with one of the other tasks.

The simple solution:

Code:
enum (+= 32) {     TASK_INV = 4562,     TASK_DISPLAY,     TASK_HIDE_ENTS }

-------------------------------------- [ 2 ] --------------------------------------

Your plugin won't compile under 1.8.2 because MAX_PLAYERS is not defined.

Code:
#if !defined MAX_PLAYERS const MAX_PLAYERS = 32 #endif

-------------------------------------- [ 3 ] --------------------------------------

I don't see a code that removes the sprites when the player disconnects?

Glad to hear that from you. You were right about all three suggestions and they are implemented. Disconnect forward removes the sprite immedietely (with the set_task it was removing later anyway).

Tested again online and tests were good with 20 players simultaneously. Not sure how the server will behave with 32/32. I highly recommend it to be used in servers with low players.

SoulWeaver16 03-07-2022 16:38

Re: Show Teammates Armament
 
Hello, report here
I have stability problems with the server, the constant message on the console, is repeated in different periods of time
https://i.imgur.com/HlXk82D.jpg
Consequently, the game freezes for 1 or 2 seconds, and the models end up underground.
https://i.imgur.com/So331DA.png
And lastly, the arrow appears for the enemy side as well, maybe there could be one more cvar.
https://i.imgur.com/Nwjrxgk.png

EFFx 03-08-2022 19:58

Re: Show Teammates Armament
 
Updated to v1.1:

- Fixed sprites floating.
- Fixed wrong sprites displaying for players.
- Fixed some overflow regarding the display of sprites when se_show_arrow_only is 1.

- Changed the way of how the sprites gets displayed, removing the delay for each player.

- Added se_show_arrow_only_mode cvar that controls which arrow players will be able to see (both teams, teammates only or only enemy team only).

EFFx 03-27-2022 15:58

Re: Show Teammates Armament
 
Updated to v1.2: Until now, it seems like a stable version, no issues were reported in all my tests with the plugin.

- Had some people telling me about crashes when testing with 32/32 bots, added a loop split so the server doesn't suffer that much displaying a LOT of sprites at once.
- Besides that loop split, there is also a code that doesn't allow the call of some natives again since the only thing that changes is the frame and the sprites' size.
- Tested with 32/32 bots and no crashes were happening with me anymore, still needs confirmations on public servers.

- Now the positions of the sprites is rightly set.
- Now the arrow position is fixed when the user is crouched.
- Now there is se_sprites_scale cvar that controls the sprites size.
- Now there is a cvar for each sprite that controls their colors individually:

se_sprite_color_weapons = default yellow
se_sprite_color_money = default green
se_sprite_color_grenades = default white (tried each grenade color individually, no pattern and combinations looks good, so by default all of them are the same color)
se_sprite_color_vesthelm = default purple
se_sprite_color_kevlar = default pink
se_sprite_color_arrow = default yellow
se_sprite_color_c4 = default orange
se_sprite_color_defusekit = default green

Siska1 03-27-2022 17:40

Re: Show Teammates Armament
 
Here I want to ask whether it is possible for this plugin to work for only a short time at the beginning of each round within the time of purchase?

bigdaddy424 03-27-2022 17:57

Re: Show Teammates Armament
 
Quote:

Originally Posted by Siska1 (Post 2775355)
Here I want to ask whether it is possible for this plugin to work for only a short time at the beginning of each round within the time of purchase?

I offered EFFx money to do exactly the same thing you said but he rejected. Cruel world we live in


All times are GMT -4. The time now is 13:25.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.