Raised This Month: $ Target: $400
 0% 

map change event ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hypheni
Senior Member
Join Date: Jul 2011
Location: India
Old 01-19-2013 , 22:51   map change event ?
Reply With Quote #1

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 ?
hypheni is offline
Send a message via Skype™ to hypheni
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-19-2013 , 22:57   Re: map change event ?
Reply With Quote #2

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.
__________________
fysiks is offline
hypheni
Senior Member
Join Date: Jul 2011
Location: India
Old 01-19-2013 , 23:28   Re: map change event ?
Reply With Quote #3

2nd method seems to be easy one but not realtime. Anyways how to trap map change event ?.
hypheni is offline
Send a message via Skype™ to hypheni
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-20-2013 , 13:45   Re: map change event ?
Reply With Quote #4

Quote:
Originally Posted by hypheni View Post
2nd method seems to be easy one but not realtime. Anyways how to trap map change event ?.
Before: plugin_end()
After: plugin_init()
__________________
fysiks is offline
hypheni
Senior Member
Join Date: Jul 2011
Location: India
Old 01-21-2013 , 01:07   Re: map change event ?
Reply With Quote #5

Couldn't get you, if possible show an example
hypheni is offline
Send a message via Skype™ to hypheni
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-21-2013 , 01:40   Re: map change event ?
Reply With Quote #6

plugin_init is called when the map starts
plugin_end is called when the map ends
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
hypheni
Senior Member
Join Date: Jul 2011
Location: India
Old 01-21-2013 , 01:55   Re: map change event ?
Reply With Quote #7

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 ?
hypheni is offline
Send a message via Skype™ to hypheni
hypheni
Senior Member
Join Date: Jul 2011
Location: India
Old 01-21-2013 , 01:58   Re: map change event ?
Reply With Quote #8

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 ?
hypheni is offline
Send a message via Skype™ to hypheni
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-21-2013 , 03:55   Re: map change event ?
Reply With Quote #9

Quote:
Originally Posted by hypheni View Post

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 ?
Yes. That is the second [less reliable] method that I described before.
__________________
fysiks is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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