View Single Post
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-02-2022 , 14:22   Re: Show Teammates Armament
Reply With Quote #5

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?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom