user-grinch / PyLoader

Python script loader for Grand Theft Auto San Andreas
GNU General Public License v3.0
29 stars 5 forks source link

How to import functions? #2

Closed mgmoldova closed 3 years ago

mgmoldova commented 3 years ago

What's wrong?

print("Hello") display_hud(0)

------------------------------
Starting PyLoader v0.01
Author: Grinch_
------------------------------
Loading script test.py
test.py: Hello
Exception: NameError "name 'display_hud' is not defined"
Traceback,
test.py: Line 2, <module>()
user-grinch commented 3 years ago

That specific function is in the opcode module so you need this,

import opcode
print("Hello")
opcode.display_hud(0)