File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ public OnPlayerConnect(playerid)
14
14
```
15
15
16
16
```python
17
- from pysamp import *
17
+ from samp import *
18
18
19
19
def OnPlayerConnect(playerid):
20
20
name = GetPlayerName(playerid, Const('MAX_PLAYER_NAME'))
@@ -24,9 +24,22 @@ def OnPlayerConnect(playerid):
24
24
25
25
As you can see, all referenced return values are removed and instead the method returns either a value or a tuple.
26
26
The corresponding python gamemode has to be saved as ` gamemode.py ` in a ` python/ ` subfolder of your server directory.
27
+ By the way, I imported the ` samp ` module here, which is actually a python module. You can find it in ` gamemodes/empty/ ` .
28
+ It wraps the SA-MP functions and handles the encoding and decoding of strings, so you don't have to bother.
29
+ * Caution:* with this module, you also get the decode method. Use it to decode the bytestrings as seen in the example gamemode in ` gamemodes/empty/ ` .
30
+
27
31
28
32
# Using
29
33
Make sure, that you installed the 32-bit Python 3.5m version on your server!
34
+ For debian and ubuntu, this should work:
35
+ ``` bash
36
+ sudo dpkg --add-architecture i386
37
+ sudo apt-get update
38
+ ```
39
+ and then:
40
+ ``` bash
41
+ sudo apt install python3-dev:i386
42
+ ```
30
43
31
44
# Compiling
32
45
If the uploaded binaries don't suite your needs, you might have to compile the project on your own.
You can’t perform that action at this time.
0 commit comments