Jump to content
Korean Random
Sign in to follow this  
Ragnarocek

Message on client connect

Recommended Posts

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 by Ragnarocek

Share this post


Link to post

Short link
Share on other sites

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
  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...