Thread: help flags
View Single Post
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-24-2020 , 02:09   Re: help flags
Reply With Quote #10

No, that is very wrong.

The important part is that you're wanting to print something to all admins that are already in the server. That actually means that you're needing to address the client_print() function, not when the new player joins the server.

The other major requirement for your plugin is that you do do the printing of the message after two events have occurred: the player has joined the server and the the player has been authenticated by Steam (meaning they have a SteamID).

I suggest that you start with just printing the name when the player is put into the server. Get that working first using client_putinserver(). Then, you can add to printing only to admins by replacing your client_print() with a for loop that goes through all connected players and then calling client_print() only on those that have admin access. I suggest that you look for other plugins and threads where you see get_players() being used, most of these will have an example of how to use it and its results in a for loop.

Once you have that working, you can then work on adding the SteamID. The simplest (but not the most proper) would be to do what was previously mentioned to add a delay. So, in client_putinserver() you would use set_task() to call a custom function that contains the player loop code that prints the message.

Try to do some of those steps and if you run into issues, post the code that you've tried and we can help you out. If you make a decent effort to do these steps on your own, people will generally be more willing to help.
__________________
fysiks is online now