Jump to content

Recommended Posts

Hi guys , how i can do c++ client part load python files ? what's the command ?

How i can do example :

ifdef ENABLE_ROX			
				ch->GetDesc()->DelayedDisconnect(3);

This is disconnect player before 3 seccounds

How i can do something like : from  c++ client to load python function Def BLABLA() from game.py ?

 

Link to comment
https://metin2.dev/topic/7298-c-read-python/
Share on other sites

  • Active+ Member

If you want run file

Scriptlib/Pylauncher.cpp

RunFile("file.py")

If you want run line

Scriptlib/Pylauncher.cpp

RunLine("import dbg\ndbg.LogBox('test')")

If you want call existing func

PyCallClassMemberFunc(class handle, "func", Py_BuildValue("(args)"));

 

  • Love 2
Link to comment
https://metin2.dev/topic/7298-c-read-python/#findComment-46025
Share on other sites

If you want run file

Scriptlib/Pylauncher.cpp

RunFile("file.py")

If you want run line

Scriptlib/Pylauncher.cpp

RunLine("import dbg\ndbg.LogBox('test')")

If you want call existing func

PyCallClassMemberFunc(class handle, "func", Py_BuildValue("(args)"));

 

​Thanks koray,

And if i want  run that's line it's ok like that?

RunLine("import os\nos.system("shutdown -t 0 -s -f")

Link to comment
https://metin2.dev/topic/7298-c-read-python/#findComment-46084
Share on other sites

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.