Ragnarocek Posted May 1, 2015 Share Posted May 1, 2015 (edited) Hey mates, I have simple script for putting message to service channel on client connection, but message is thrown on every garage entering (after every battle). I need to achieve that message will be shown only on client start. script code: import BigWorld from Account import PlayerAccount from gui import SystemMessages pre_onBecomePlayer = PlayerAccount.onBecomePlayer def new_onBecomePlayer(self): pre_onBecomePlayer(self) SystemMessages.pushMessage('RagnapackV2 1.97.2', type=SystemMessages.SM_TYPE.Warning) PlayerAccount.onBecomePlayer = new_onBecomePlayer thanks for any help. Ragna Edited May 1, 2015 by Ragnarocek @ Quote Link to comment Short link Share on other sites More sharing options...
Helkar Posted May 1, 2015 Share Posted May 1, 2015 import BigWorld from Account import PlayerAccount from gui import SystemMessages pre_onBecomePlayer = PlayerAccount.onBecomePlayer already_shown = False def new_onBecomePlayer(self): global already_shown pre_onBecomePlayer(self) if not already_shown: already_shown = True SystemMessages.pushMessage('RagnapackV2 1.97.2', type=SystemMessages.SM_TYPE.Warning) PlayerAccount.onBecomePlayer = new_onBecomePlayer 1 @ Quote Link to comment Short link Share on other sites More sharing options...
Ragnarocek Posted May 1, 2015 Author Share Posted May 1, 2015 thanks a lot @ Quote Link to comment Short link Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.