Jump to content

Little python check question


Go to solution Solved by Denizeri24,

Recommended Posts

  • Gold

Hey guys,

 

is here someone who know how to do a Game Master check for CTRL+V function? File: root\game.py

def OnKeyDown(self, key):
        if app.DIK_F1 == key:
            return False
        if app.DIK_F2 == key:
            return False
        if app.DIK_F3 == key:
            return False
        if app.DIK_F4 == key:
            return False
        if app.DIK_LALT == key:
            return False
        if app.DIK_SYSRQ == key:
            return False
        if app.DIK_LCONTROL == key:
            return False
        
        #CTRLV FUNCITON
        if app.DIK_V == key:
            if app.IsPressed(app.DIK_LCONTROL):
                ime.PasteTextFromClipBoard()

Thanks for possible solutions!

Edited by ReFresh

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Contributor

Idk why chr.IsGameMaster don't work for you, but here is another solution:

if app.DIK_V == key:
	if app.IsPressed(app.DIK_LCONTROL) and str(player.GetName())[0] == "[":
			ime.PasteTextFromClipBoard()

It will check if the player name starts with "[". If you have [VIP] or other role then edit the code to exclude them.

chr.IsGameMaster is better but since it's clientside, it really doesn't matter, the pro users can reach and modify it anyways.

Edited by TMP4
  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 0

      Moving server from FreeBSD 11.2 to 13.2 - lib needed

    2. 0

      I just implemented some costumes and they are not visible

    3. 0

      Skill Tree Problem

    4. 97

      Ulthar SF V2 (TMP4 Base)

    5. 5

      Client Crashes through Offline Shop (Ikarus)

    6. 5

      VIVY-WORLD2 - FARM TO THE TOP

    7. 0

      ToolTip Bug?

    8. 0

      Skill tree build erorr

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.