map change event ?
What I'm trying to do is print admin name while he joins the server. If I put the method in client_putinserver or client_connect it will print even when map changes and all admin names will be printed in a quick sequence.
I need to show status if admin is connected while map is live not changed to a new map. Any ideas ? |
Re: map change event ?
You probably have to store all the admins that are currently on the server at the time the map changes and then when the map starts, check to see if they are in that list. If they are, don't print their name.
A less reliable but easier alternative is to not display any names within the first X seconds of the map start. This means that the majority of the time, the admins that were already on the server at the end of the last map will not get displayed. Only the admins that join after X seconds after map start will be displayed. |
Re: map change event ?
2nd method seems to be easy one but not realtime. Anyways how to trap map change event ?.
|
Re: map change event ?
Quote:
After: plugin_init() |
Re: map change event ?
Couldn't get you, if possible show an example
|
Re: map change event ?
plugin_init is called when the map starts
plugin_end is called when the map ends |
Re: map change event ?
But each time map changes the plugin loaded to game memory from beginning, is it possible to increment a global counter to detect map change event ?
|
Re: map change event ?
I guess the way suggested by fysiks is better.
set a task from plugin_init which will execute few seconds later from plugin initialization and setting a global value true. then depending on that check execute proper code from client_connect/client_putinserver. Correct ? |
Re: map change event ?
Quote:
|
| All times are GMT -4. The time now is 13:39. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.