python plugin help
#1

hello, i need help on installing python plugin for sa-mp dedicated server, this is for makeing scripts in python for sa-mp servers, my problem is that i don't know what do i need to open in the gamemode directory to can start scripting.
when i installed the plugin i added into the plugin directory, and from there i copy pasted the pawn.amx into the gamemode directory, but what to open to can start scripting?
any helpfull is apreciated thanks and sorry if i posted in wrong section
Reply
#2

first put the plugin in the plugins folder, then on server.cfg put python(or w/e it called) near plugins. (if u dont have the plugins line, do plugins python or w/e). then on top of ur script put #include <python>(or w/e it is)
Reply
#3

i don't understand, all i did it was this:
1: i downloaded the plugin and i saved into the plugin directory.
2 i copy pasted from the plugin directory the python.amx into the gamemodes directory, and also there i created two python files called "__init__" and "gamemode"
3: i added this "plugins pythonplugin.so" into the server.cfg
this is all i did, the problem now is that i don't get it what do i need to open into the gamemodes directory to can start scripting, plz i need help thanks
when i will make a server do i need to open python program and to write there the script maybe? and then to add it into the gamemodes?
Reply
#4

on top of your scropt gamemode put #include pythonplugin. do u have windows or linux?
Reply
#5

in my gamemodes where is all the servers, i have one file called gamemode wich is a empty python file so u mean to open that? if yes then i can't open it only with python program.
and what u mean with including pythonplugin, u mean into the gamemode file?
in python if something is included it need to use the import statement, pawn language is a bit diferent then python, if u mean about including the plugin into the gamemode file then i must use "import pythonplugin"
anyway what u mean about that plugin? where is that
Reply
#6

You can just open gamemode.py in gamemodes with any text editor (i.e. Notepad++, which brings a shell extension to easily open any files) and write your Python script. After that you only need to start the server and the new script will be loaded.
If you don't know how to start a script, there are some example scripts in the downloaded archive.

Also, you need to set the gamemode to python in server.cfg, or it won't load the Python script, see the plugin topic, everything important should be explained there.
Reply
#7

and when i will start makeing the script in python how i can include all the functions from sa-mp? i want to use all built-in functions from sa-mp.
i tryed this: import a_samp, but i get errors.
Reply
#8

Well, you should read one of the (or both) example scripts first, they are in the directory "python" in the archive you downloaded ("gamemode.py" and "testgm.py"). Any SA-MP functions and constants are in the module "samp".
Reply
#9

i tryied to write a script in python and then to save it into the gamemode directory.
in the python when i press f5 to test if the script is working good, i get an error:

Traceback (most recent call last):
File "C:\SETUP jocuri\Grand Theft Auto San Andreas Setup\SA-MP My Server\samp03csvr_R2-2_win32\gamemodes\python.py", line 1, in <module>
import samp
ImportError: No module named samp

need help thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)