Thread: help flags
View Single Post
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-25-2020 , 11:25   Re: help flags
Reply With Quote #13

@Foxa

1. The steam ID will not always be available at client_connect(). I recommend using client_authorized() if you require the steam ID.
2. Your code is written to print to only those who have the specified admin status/flags but then you use 0 in client_print, which prints to everyone. So everyone would see the same print <number of players> number of times. Change this to the player id.
3. Capture the steam id in a global variable so it can be re-used when the player disconnects. No sense in calling a native that returns the same value twice.
4. Your code would not work if the Flag variable held more than 1 flags.
5. I would add "ch" flags to get_players() to exclude bots/HLTV.
6. 'stock' should not be used within a plugin, only include files.

@1M1e - I would avoid printing the 'connecting' and 'connected' messages, use connected only since you are guaranteed to have steam ID at authorized(). It would be annoying to see the same message back to back for each player.

Spoiler
__________________

Last edited by Bugsy; 07-25-2020 at 11:59.
Bugsy is offline