Jump to content
Korean Random
AddNikita

Какой код на python 2.7 нужно написать, чтобы мод включался/выключался по началу и завершению боя?

Recommended Posts

Какой код на python 2.7 нужно написать, чтобы мод включался/выключался по началу и завершению боя?

Share this post


Link to post

Short link
Share on other sites
14 часов назад, SkepticalFox сказал:

 

Препод-тролль  80 лвл :veryhappy:

from Avatar import PlayerAvatar

old_onBecomePlayer = PlayerAvatar.onBecomePlayer

def new_PlayerAvatar_onBecomePlayer(self):
    old_onBecomePlayer(self)
    global MY_MODE_ON
    MY_MODE_ON = True

PlayerAvatar.onBecomePlayer = new_PlayerAvatar_onBecomePlayer

old_onBecomeNonPlayer = PlayerAvatar.onBecomeNonPlayer

def new_PlayerAvatar_onBecomeNonPlayer(base, self):
    global MY_MODE_ON
    MY_MODE_ON = False    
    old_onBecomeNonPlayer(self)

PlayerAvatar.onBecomeNonPlayer = new_PlayerAvatar_onBecomeNonPlayer

 

Edited by StranikS_Scan

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.

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.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...