Posts: 25
Threads: 8
Joined: Feb 2011
Reputation:
0
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
Posts: 490
Threads: 122
Joined: Feb 2010
Reputation:
0
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)
Posts: 25
Threads: 8
Joined: Feb 2011
Reputation:
0
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?
Posts: 490
Threads: 122
Joined: Feb 2010
Reputation:
0
on top of your scropt gamemode put #include pythonplugin. do u have windows or linux?
Posts: 25
Threads: 8
Joined: Feb 2011
Reputation:
0
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
Posts: 25
Threads: 8
Joined: Feb 2011
Reputation:
0
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.
Posts: 20
Threads: 2
Joined: May 2009
Reputation:
0
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".
Posts: 321
Threads: 93
Joined: Jun 2009
Reputation:
0
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