Jump to content

Little python check question


Go to solution Solved by Denizeri24,

Recommended Posts

  • Active+ Member

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
https://metin2.dev/topic/27535-little-python-check-question/
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

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.