[Plugin] nPawn - latest Pawn in SA-MP
#1

This plugin updates Pawn to the latest version from CompuPhase's repository without loss of original API.


Overview of main Pawn changes:

1. Structures
PHP код:
new msg[.text{30}, .priority];
msg.priority 10;
strpack(msg.text"update: {30} means [30 char]");
print(
msg.text); 
2. Enumerated lists
PHP код:
// from file.inc
const filemode:
{
io_read 0/* file must exist */
io_write/* creates a new file */
io_readwrite/* opens an existing file, or creates a new file */
io_append/* appends to file (write-only) */

3. Lots of new natives in Pawn includes, e. g., functions that were added to file.inc:
PHP код:
native boolfcopy(const source[], const target[]);
native boolfrename(const oldname[], const newname[]);
native boolfcreatedir(const name[]);
native boolfstat(name[], &size 0, &timestamp 0, &mode 0, &inode 0);
native boolfattrib(const name[], timestamp=0attrib=0x0f);
native filecrc(const name[]);
// ini reader
native readcfg(const filename[]=``'', const section[]=``'', const key[], value[], size=sizeof value, const defvalue[]=``''bool:pack=true);
native readcfgvalue(const filename[]=``'', const section[]=``'', const key[], defvalue=0);
native boolwritecfg(const filename[]=``'', const section[]=``'', const key[], const value[]);
native boolwritecfgvalue(const filename[]=``'', const section[]=``'', const key[], value);
native booldeletecfg(const filename[]=``'', const section[]=``'', const key[]=``''); 
Also you can read about changes at official page: http://www.compuphase.com/pawn/pawnhistory.htm


Changes and additions for API that aren't related to Pawn update:

1. Callback arguments are packed
2. It's safe to use packed strings with SA-MP functions
3. Some natives like GetPlayerName/GetWeaponName/etc got argument bool:ispacked=true at end.
4. format native that was taken from AMXMODX has been replaced with Pawn's strformat.
5. New include: a_vec.inc. It includes Vector3-powered versions of some SA-MP functions that have "Vec" suffix. Vector3 is a structure with fields Float, Float:y and Float:z. Example of usage:
PHP код:
new pos[Vector3];
GetPlayerPosVec(playeridpos);
pos.+= 20.0;
SetPlayerPosVec(playeridpos); 
Known issues:

- filterscripts crash the server. Looks like it will not be fixed because it will break support of most SA-MP versions or/and reduce performance
- Some plugins may not work with nPawn. Most of sampgdk-based plugins will not work.


Links:
Source code: https://github.com/g3o0or/npawn-samp
Binaries (Windows/Linux plugin and pawncc): https://github.com/g3o0or/npawn-samp/releases
Resources (updated includes and examples): https://github.com/g3o0or/npawn-samp...ster/resources
Reply
#2

BIG UP dude
Gonna try this right now!
Reply
#3

It`s nice script. But me and my friend, we saw this:
Код:
- Some plugins may not work with nPawn. Most of multithreaded plugins will not work.
This issue is worries us, it will be fixed in next update or not?
Reply
#4

When a safer solution is made, I'd definitely use this. It just doesn't exactly seem possible to fully support the latest PAWN without implementing this in the SA-MP server itself.

But still, you've done a really nice job.
Reply
#5

Quote:
Originally Posted by Sanady
Посмотреть сообщение
it will be fixed in next update or not?
Yes, I'm currently working on improving compatibility. I've just fixed compatibility with some plugins, but Streamer's initialization still fails. Updated binaries will be available later.
Reply
#6

I hope that you can fix this..
Quote:

- filterscripts crash the server. Looks like it will not be fixed because it will break support of most SA-MP versions or/and reduce performance

Reply
#7

Quote:
Originally Posted by ge0r
Посмотреть сообщение
Yes, I'm currently working on improving compatibility. I've just fixed compatibility with some plugins, but Streamer's initialization still fails. Updated binaries will be available later.
Glad to hear that.
Reply
#8

Quote:
Originally Posted by Sanady
Посмотреть сообщение
it will be fixed in next update or not?
Latest update works well with MySQL R39-5 (needs to replace enum with const and replace [] = "" with [] = ``''), log plugin (needs to replace enum with const), sscanf (needs to replace [MAX_PLAYERS char] -> {MAX_PLAYERS} and [ % 7] -> { % 7} in sscanf2.inc), nativechecker and Pawn.CMD. Don't work only sampgdk-based plugins (Streamer).
Reply
#9

Looks nice. So it actually replaces samps internal pawn interpreter with the new version?
A performance comparison would be nice to see, i cant test this on my own atm.
Reply
#10

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
Looks nice. So it actually replaces samps internal pawn interpreter with the new version?
A performance comparison would be nice to see, i cant test this on my own atm.
In some cases it wins, but in most cases it's (temporarily) bit slower. In future versions perfomance will be improved as plugin will use optimized abstract machine.
Reply
#11

Quote:

C:\Users\Mr.C\Desktop\My Server\pawno\include\file.inc(9) : error 020: invalid symbol name ""
C:\Users\Mr.C\Desktop\My Server\pawno\include\file.inc(17) : error 020: invalid symbol name ""
C:\Users\Mr.C\Desktop\My Server\pawno\include\file.inc(25) : error 017: undefined symbol "io_readwrite"
C:\Users\Mr.C\Desktop\My Server\pawno\include\file.inc(40) : error 017: undefined symbol "seek_start"
C:\Users\Mr.C\Desktop\My Server\pawno\include\file.inc(4 : error 029: invalid expression, assumed zero
C:\Users\Mr.C\Desktop\My Server\pawno\include\file.inc(4 : error 001: expected token: ";", but found "`"
C:\Users\Mr.C\Desktop\My Server\pawno\include\file.inc(49) : error 029: invalid expression, assumed zero
C:\Users\Mr.C\Desktop\My Server\pawno\include\file.inc(49) : error 001: expected token: ";", but found "`"
C:\Users\Mr.C\Desktop\My Server\pawno\include\file.inc(50) : error 029: invalid expression, assumed zero
C:\Users\Mr.C\Desktop\My Server\pawno\include\file.inc(50) : error 001: expected token: ";", but found "`"
C:\Users\Mr.C\Desktop\My Server\pawno\include\file.inc(51) : error 029: invalid expression, assumed zero
C:\Users\Mr.C\Desktop\My Server\pawno\include\file.inc(51) : error 001: expected token: ";", but found "`"
C:\Users\Mr.C\Desktop\My Server\pawno\include\file.inc(52) : error 029: invalid expression, assumed zero
C:\Users\Mr.C\Desktop\My Server\pawno\include\file.inc(52) : error 001: expected token: ";", but found "`"
C:\Users\Mr.C\Desktop\My Server\gamemodes\RP.pwn(19035) : error 017: undefined symbol "io_read"
C:\Users\Mr.C\Desktop\My Server\gamemodes\RP.pwn(19055) : error 017: undefined symbol "io_read"
C:\Users\Mr.C\Desktop\My Server\gamemodes\RP.pwn(19071) : error 017: undefined symbol "io_read"
C:\Users\Mr.C\Desktop\My Server\gamemodes\RP.pwn(19092) : error 017: undefined symbol "io_read"
C:\Users\Mr.C\Desktop\My Server\gamemodes\RP.pwn(19113) : error 017: undefined symbol "io_read"
C:\Users\Mr.C\Desktop\My Server\gamemodes\RP.pwn(19174) : error 017: undefined symbol "io_read"
C:\Users\Mr.C\Desktop\My Server\gamemodes\RP.pwn(19195) : error 017: undefined symbol "io_read"
C:\Users\Mr.C\Desktop\My Server\gamemodes\RP.pwn(19216) : error 017: undefined symbol "io_read"
C:\Users\Mr.C\Desktop\My Server\gamemodes\RP.pwn(19233) : error 017: undefined symbol "io_read"
C:\Users\Mr.C\Desktop\My Server\gamemodes\RP.pwn(19254) : error 017: undefined symbol "io_read"
C:\Users\Mr.C\Desktop\My Server\gamemodes\RP.pwn(19275) : error 017: undefined symbol "io_read"
C:\Users\Mr.C\Desktop\My Server\gamemodes\RP.pwn(19302) : error 017: undefined symbol "io_write"

Compilation aborted.

Pawn compiler 3.10.20160702 Copyright © 1997-2006, ITB CompuPhase


26 Errors.

--------------===================--------------------
Reply
#12

Quote:
Originally Posted by Belengher
Посмотреть сообщение
Pawn compiler 3.10.20160702 Copyright © 1997-2006, ITB CompuPhase
That script file must be compiled with the compiler provided in this project github page, not with SA-MP's nor Zeex's.
Reply
#13

Interesting if someone got a copy of the source of this plugin, would be nice if he shared it since the original creator of this plugin has deleted all his repositories.
Reply
#14

Yes there is, just like the first version, look at what fixes were done can do and update if you want to throw off.
Reply
#15

Quote:
Originally Posted by Salik
Посмотреть сообщение
Yes there is, just like the first version, look at what fixes were done can do and update if you want to throw off.
I don't know if you've noticed, but the download/source link is down.
Reply
#16

Reupload please!
Reply
#17

Why is the development dead?
Reply
#18

https://github.com/g3o0or/ he deleted it
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)