Giter Club home page Giter Club logo

pawnplus's Introduction

PawnPlus v1.4.3

PawnPlus extends the possibilities of the Pawn scripting language with new constructs, data types, and programming techniques.

With this plugin, you can use techniques like asynchronous task-based programming, reflection, hooking, and dynamic structures to make programming in Pawn easier, simpler, and more efficient.

PawnPlus introduces dynamically sized strings, lists, linked lists, and maps. Collections can contain any number of elements of any type (cells or arrays) and any tag. They can be iterated using versatile iterator objects. Tasks can be used to execute code based on a specific event, without creating additional callbacks and without blocking the program.

Several new object types use the garbage collector present in the plugin, removing the need to explicitly delete memory in most cases.

Documentation

See the wiki for documentation and tutorials on how to use this plugin.

Installation

Download the latest release for your platform to the "plugins" directory and add "PawnPlus" (or "PawnPlus.so" on Linux) to the plugins line in server.cfg.

Include PawnPlus.inc in your Pawn program and you are done.

Configuration

This plugin can optionally add a number of syntax features to Pawn like additional statements or operators. These are not available by default due to conflicts with other libraries, but you can use them all if you define PP_SYNTAX, or selectively via other definitions. If you are writing a library, it is recommended not to use any configuration definitions.

Building

Use Visual Studio to build the project on Windows, or make or make static on Linux. Requires GCC >= 4.9.

Credits

  • Zeex for creating subhook without which this wouldn't be possible.
  • Y_Less for help with macros for generic functions.
  • TommyB for thorough testing and bug-finding.
  • Southclaws and AGraber for minor contributions.

Thanks to all PawnPlus users for your support!

pawnplus's People

Contributors

agraber avatar germanaizek avatar is4code avatar se8870 avatar southclaws avatar spacemud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pawnplus's Issues

task_detach crash with JIT

Using the task_detach function and later using any asynchronous function crashes the server if the script is JIT compiled.

Running this script in Windows and with jit_sleep enabled, the server crashes after "detached" gets printed on the console.

#include <PawnPlus>
#include <a_samp>
#include <jit>

public OnJITCompile()
{
	return 1;
}

myfunc(time)
{
	printf("myfunc(time = %i)", time);

	print("detaching...");
	task_detach();
	task_yield(1);
	print("detached");
	
	wait_ms(time);
	
	printf("%i milliseconds have passed", time);
	
	return 1;
}

main()
{
	new r = myfunc(1000);
	printf("myfunc returned %i", r); 
	return 0; 
}

With no JIT, it gives the expected output:

myfunc(time = 1000)
detaching...
detached
myfunc returned 1
Number of vehicle models: 0
1000 milliseconds have passed

Including PawnPlus crashes Compiler

Hi,
I just started using PawnPlus and tried including it in my script.
But pawncc.exe crashes everytime I try to compile the script, after including PawnPlus.inc
Also crashes when I include it in a new blank script.

I'm using Version 1.2.1 of PawnPlus.
PawnPlus.inc is located in my pawno/includes directory
My includes:

#include <a_samp>
#include <PawnPlus>

I probably did something wrong, it's been a while since I used Pawno, but I could not figure out why the compiler crashes.

Seed for math random functions

It currently generates always the same sequence of numbers. Can you possibly add a function like srand to set the seed of the random generator?

Extendable format specifiers

It would be nice to be able to define our own format specifiers, and be able to use them with the str_format* family of functions. A nice way would be to have a native to register public functions for a format specifier. Im aware of the existance of tag_op_string which gets called when a custom tag value in a variant, but that requires making a variant and then passing that variant. Now, I know there's some new complex features for formatting, like width, precision and etc. Although probably not really necessary for most use cases, it could be benefiting to have them passed as arguments to the specifier functions.

This is a rough example of what I have in mind. The format_input_type_int is just something made up for now, maybe there's a better way to determine or specify the type of the receiving function (or maybe pass it as is, but making a copy of the reference in case of cells).

native register_format_specifier(character, const function[], format_input_type:format_input_type);

pawn_on_init[formatSpecifiers]()
{
    register_format_specifier('P', "PlayerNameFormatSpecifier", format_input_type_cell);
    // let's assume playerid 2 is named Graber
    print_s(str_format("playerid 2 is %P", 2);
    // would print: "playerid 2 is Graber"
}

forward String:PlayerNameFormatSpecifier(playerid /*,width?, precision?, etc*/);
public String:PlayerNameFormatSpecifier(playerid /*,width?, precision?, etc*/)
{
    // let's say the script already has saved the name for us in some variable
    return SavedPlayerName[playerid];
}

Crash

do not crashing when:

  • removing crashdetect or pawnplus ON LINUX
  • running server on windows

https://hastebin.com/yicogatuva.cs

root@brabus:~/server# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

linux crash

latest revision crashes the server on loadup

[18:55:12] [debug] Server crashed due to an unknown error
[18:55:12] [debug] Native backtrace:
[18:55:12] [debug] #0 f738c371 in _Z13GetStackTraceRSt6vectorI10StackFrameSaIS0_EEPv () from plugins/crashdetect.so
[18:55:12] [debug] #1 f738396d in _ZN18CrashDetectHandler20PrintNativeBacktraceERSoRKN2os7ContextE () from plugins/crashdetect.so
[18:55:12] [debug] #2 f738498d in _ZN18CrashDetectHandler20PrintNativeBacktraceERKN2os7ContextE () from plugins/crashdetect.so
[18:55:12] [debug] #3 f7386d1d in _ZN18CrashDetectHandler7OnCrashERKN2os7ContextE () from plugins/crashdetect.so
[18:55:12] [debug] #4 f738b83c in ?? () from plugins/crashdetect.so
[18:55:12] [debug] #5 f7799bd0 in ?? ()
[18:55:12] [debug] #6 f7799be9 in ?? ()
[18:55:12] [debug] #7 f73e3ea9 in gsignal () from /lib/i386-linux-gnu/libc.so.6
[18:55:12] [debug] #8 f73e5407 in abort () from /lib/i386-linux-gnu/libc.so.6
[18:55:12] [debug] #9 f765091d in ?? () from /usr/lib/i386-linux-gnu/libstdc++.so.6
[18:55:12] [debug] #10 f76580d4 in ?? () from /usr/lib/i386-linux-gnu/libstdc++.so.6
[18:55:12] [debug] #11 f765813d in ?? () from /usr/lib/i386-linux-gnu/libstdc++.so.6
[18:55:12] [debug] #12 f76584b0 in __cxa_rethrow () from /usr/lib/i386-linux-gnu/libstdc++.so.6
[18:55:12] [debug] #13 f5699930 in _ZNSt10_HashtableISsSt4pairIKSsPFiP6tagAMXPiEESaIS7_ENSt8__detail10_Select1stESt8equal_toISsESt4hashISsENS9_18_Mod_range_hashingENS9_20_Default_ranged_hashENS9_20_Prime_rehash_policyENS9_17_Hashtable_traitsILb1ELb0ELb1EEEE21_M_insert_unique_nodeEjjPNS9_10_Hash_nodeIS7_Lb1EEE () from plugins/PawnPlus.so
[18:55:12] [debug] #14 f5697d11 in _ZN3amx16register_nativesEP6tagAMXPK18tagAMX_NATIVE_INFOi () from plugins/PawnPlus.so
[18:55:12] [debug] #15 f56ab8bf in _ZN5Hooks12amx_RegisterEP6tagAMXPK18tagAMX_NATIVE_INFOi () from plugins/PawnPlus.so
[18:55:12] [debug] #16 0809b463 in ?? () from ./samp03svr
[18:55:12] [debug] #17 080a1220 in ?? () from ./samp03svr
[18:55:12] [debug] #18 080ab601 in ?? () from ./samp03svr
[18:55:12] [debug] #19 080aba0b in ?? () from ./samp03svr
[18:55:12] [debug] #20 080aa0fd in ?? () from ./samp03svr
[18:55:12] [debug] #21 f73d0637 in __libc_start_main () from /lib/i386-linux-gnu/libc.so.6

Run time error 10: "Native function failed"

Hi!

I have a bit of a problem with the PawnPlus library, the error described in the console is "Run time error 10:" Native function failed "", looking forward to your help.

Capture

InsertPhoneMessage(phoneid, targetid, targetphoneid, const content[])
{
    new
        str[600],
        hour, minute, second,
        year, month, day;
    
    new message[E_MESSAGE_PHONE];
    message[messagePhoneOwner] = targetphoneid;
    gettime(hour, minute, second);
    format(str, sizeof(str), "%02d:%02d:%02d", hour, minute, second);
    format(message[messageTime], sizeof message[messageTime], str);
    getdate(year, month, day);
    message[messageDay] = day;
    message[messageMonth] = month;
    message[messageYear] = year;
    message[messageNumberSender] = InfoPhone[phoneid][phoneNumber];
    format(message[messageContent], sizeof message[messageContent], content);

    return list_add_arr(messages, message);
}

Question :)

Well, hello world!
This is my code:

public OnPlayerConnect(playerid)
{
	/*-----------------------------------*/
	TogglePlayerSpectating(playerid, true);
	/*-----------------------------------*/
	Ulogovan[playerid] = false;
	/**/
	if(fexist(Korisnici(playerid)))
	{
		INI_ParseFile(Korisnici(playerid), "LoadUser", .bExtra = true, .extra = playerid);
	}
	else
	{
		wait_ticks(1);		
	}
	/*-----------------------------------*/
	return 1;
}

Imagine that this is not wait_ticks(1) but the task that is like 20sec long...
And IF this player i started register timer for, disconnects while task is still running and other player (with same ID) connects, would other player get that timer executed on his ID because this task wasn't executed. ( 1st player which is not registered quits and than 2nd ( registered ) player get tasks executed even if he registered )????
Or Unregistered player get task from logged in player cuz registered player quit server?
Example:
[22:00:01] (!fexist(UnRegistered)) John connected to the server.
[22:00:01] (( task started ))
[22:00:03] John quits the server even tho task is started..
[22:00:05] (fexist(Register)) Nicolas (Same playerid as JOHN) connected to the server.
[22:00:05](( previous task wasn't ended yet ))
Would John get task from unregistered player or can I kill all tasks for SPECIFIC ID...
Example kill all player's tasks when disconnect?

String is null

static 
	String: itemDB_Desc[MAX_ITEMS];

String:GetItemData_Desc(ITEM: itemid)
	return itemDB_Desc[itemid];

ITEM: NewItem(const name[MAX_ITEM_NAME], const SQLname[MAX_ITEM_NAME], const desc[] = "No information", const Float: preview[4], model)
{
	//some working code

	itemDB_Desc[newitem] = str_new(desc);

	return newitem;
}

// creating item
NewItem("Mobile phone", "phone", "Mobile phone description", Float:{0.0, 0.0, 0.0, 1.0}, 18866);

// and code

native ShowPlayerDialogAMXStr(playerid, dialogid, style, caption[], AmxString:info, button1[], button2[]) = ShowPlayerDialog;

// showing dialog
ShowPlayerDialogAMXStr(playerid, dialog_none, DIALOG_STYLE_MSGBOX, "Item information",
GetItemData_Desc(PlayerInventory[playerid][i][INV_ITEMID]), "Okay", "");


// PlayerInventory[playerid][i][INV_ITEMID] gives right value

// also tried

new buffer[128];

str_get(GetItemData_Desc(PlayerInventory[playerid][i][INV_ITEMID]), buffer);
print(buffer);

//prints (null)```

a question about default callbacks

Is it possible to "re-write" the default callbacks, so we can use dynamically sized strings in default callbacks

Example:
public OnPlayerText(playerid, text[])

I started using this plugin few hours ago and I'm a newbie in pawn so I would like to know if we can do this or is "text[]" already a dynamically sized string by default?

Unable to create directory "D:\Program Files\..."

Because Output Directory is set to:

D:\Program Files\Rockstar Games\GTA San Andreas\Samp server\0.3.7\plugins\

in Visual Studio project properties, someone who doesn't have that directory can't build the plugin successfully after cloning it.

map_clear_deep removes reference

I don't know if it's intentional or not buf if you use map_clear_deep map becomes invalid. It seems that map_clear don't reproduce this error.

Code:

new Map:test = map_new();
map_clear_deep(test);

for_map(i : test)
{
		
}

Message log:
[PawnPlus] map_iter: map reference is invalid (value 0x629CD4)

task_set_result resulting 0?

Hey there. I changed my old code a bit, in the old code I stored the ID in a seperate variable, now I instead pass the ID over task_set_result.

https://pastebin.com/pb4YWxGQ

When someone does the /badge command, it executes the SelectPlayerFaction function, which then checks how many factions the player is a member of. If there's only one faction, it should set the ID of that faction as the result. It does set a result, but for some reason it always sends back 0 to the command. I also printed out the value of Iter_First and it does print out the currect value. What is also odd, is that when a player is a member of multiple factions and he goes through the dialog and selects a faction, it does somehow work.

I've tried everything, there's no errors, warnings or anything strange in any of the logs. This is also all of my code in regards to the PlayerInfo[playerid][pAwaitMembershipSelection] task, so it's not being reset or something in the background. I even reverted back to the old style where I stored the information in a seperate variable, and that doesn't work either, leading me to think it has something to do with the "case 1" part I added inbetween, but there's nothing wrong there, so I'm legitimately confused.

Server crashes at Ubuntu 20.04

Static/normal version v1.3.1

[23:30:27]  PawnPlus v1.3.1 loaded
[23:30:27]  Created by IllidanS4
[23:30:27]   Loaded.

[23:30:27]   Loaded.
[23:30:27]  Loaded 13 plugins.

[23:30:27] [debug] Server crashed due to an unknown error

argument 'index' is out of range

I use the dynamic container list to store the list of vehicles, however when using list_get_arr_safe to check and get data from index an error occurs.

[Info] [PawnPlus] Warning: amx_FindPublic returned negative index -10063 for function 'pp_on_error'. Possible collision with SAMPGDK detected. Use pp_public_min_index or pp_use_funcidx to remove this warning.
[PawnPlus] list_get_arr_safe: argument 'index' is out of range
[Info] [debug] Run time error 10: "Native function failed"

Below is my code:

new resultData[E_PLAYER_VEHICLES];

for(new i; i < MAX_PLAYERVEHICLE_SLOT; i++)
{
    if (list_get_arr_safe(vehicles_list, i, resultData))
    {
        format(dialog_info, _, "%s\n", Model_Name(resultData[vehicle_Model]));
        continue;   
    }

    strcat(dialog_info, "Empty\n");
}

MAX_PLAYERVEHICLE_SLOT is the number of player vehicle storage slots (default: 10)

Failed loading plugin

Hey there.
I want to start to use your plugin on my game server. I have tried to use it with my Linux Server (CentOS 7.5.1804), but it fails to start. Error - Failed (plugins/PawnPlus.so: undefined symbol: _ZN4impl11native_infoIXadL_ZN7Natives7var_subEP6tagAMXPiEEE4nameE). How can you help us?

[PawnPlus] task_wait: task reference is invalid (value 0x0)

Hi there.
I have these two tasks executing when the player login with correct password. It works fine but after having logged in, I disconnect, re-connect and login again (repeat until the 5th time), the tasks have issues.
Re-initiating the server makes it work again but the tasks still have issues after a few time re-logging in.
Here is my code and errors: https://pastebin.com/xMm6hF6z
I don't know if my tasks are written in a wrong way but please help.
Thank you for your time!

pawn_register_callback, handler_return and callback parameters

A normal handler:

pawn_register_callback("OnPlayerConnect", "AntiFlood_OPC");

calls AntiFlood_OPC with correct playerid. A special handler with handler_return calls AntiFlood_OPC with correct return value but wrong playerid.

From wiki:
flags specify how the function should be handled. handler_return will place an additional by-ref parameter before the callback parameters to specify what should be returned from the callback.

pawn_register_callback("OnPlayerConnect", "AntiFlood_OPC", handler_return, "d", 0);
forward public AntiFlood_OPC(break_hook_chain, playerid);
public AntiFlood_OPC(break_hook_chain, playerid)
{
    ...

    if (condition)
    {
        break_hook_chain = 1; // do not call other handlers for OnPlayerConnect
    }
    return break_hook_chain;
}

playerid has value of 3964 when debugging it. If I change value 0 from pawn_register_callback to something random, it is printed correctly so the issue is only with the callback parameters.

Crash using str_format in MySQL functions

Server seems to crash using the return string of str_format in MySQL functions, as mysql_tquery**_s** and mysql_pquery**_s**.

Used plugins (in order of load)

  1. Crashdetect 4.20
  2. PawnPlus 1.3.1
  3. MySQL R41-4

Crash log

[00:14:01] [debug] Server crashed while executing bare.amx
[00:14:01] [debug] AMX backtrace:
[00:14:01] [debug] #0 native mysql_tquery () in mysql.DLL
[00:14:01] [debug] #1 0000025c in public OnGameModeInit () in bare.amx
[00:14:01] [debug] Native backtrace:
[00:14:01] [debug] #0 6bddefae in ?? () in log-core.dll
[00:14:01] [debug] #1 6bddf10c in ?? () in log-core.dll
[00:14:01] [debug] #2 6bddd8ee in ?? () in log-core.dll
[00:14:01] [debug] #3 68075e76 in ?? () in plugins\mysql.DLL
[00:14:01] [debug] #4 6808d7bd in ?? () in plugins\mysql.DLL
[00:14:01] [debug] #5 004010b6 in ?? () in samp-server.exe
[00:14:01] [debug] #6 5b79f96e in ?? () in plugins\crashdetect.DLL
[00:14:01] [debug] #7 5b7a5a81 in ?? () in plugins\crashdetect.DLL
[00:14:01] [debug] #8 5b7991a5 in ?? () in plugins\crashdetect.DLL
[00:14:01] [debug] #9 5b79f9dc in ?? () in plugins\crashdetect.DLL
[00:14:01] [debug] #10 10014c6e in ?? () in plugins\PawnPlus.DLL
[00:14:01] [debug] #11 0040174f in ?? () in samp-server.exe
[00:14:01] [debug] #12 1001866e in ?? () in plugins\PawnPlus.DLL
[00:14:01] [debug] #13 0046f654 in ?? () in samp-server.exe
[00:14:01] [debug] #14 65646f6d in ?? () in samp-server.exe
[00:14:01] [debug] #15 61622f73 in ?? () in samp-server.exe
[00:14:01] [debug] #16 612e6572 in ?? () in samp-server.exe
[00:14:01] [debug] Registers:
[00:14:01] [debug] EAX: 00000000 EBX: 00000001 ECX: 00000001 EDX: 00000000
[00:14:01] [debug] ESI: 00000000 EDI: 00000004 EBP: 0019f574 ESP: 0019f568
[00:14:01] [debug] EIP: 6bddefae EFLAGS: 00010246
[00:14:01] [debug] Stack:
[00:14:01] [debug] ESP+00000000: 00000004 0019f82c fdb96d90 0019f598
[00:14:01] [debug] ESP+00000020: 00000001 0019f5ac 00000000 00000000
[00:14:01] [debug] ESP+00000040: fdb96d90 6bddd795 6bde2674 00000022
[00:14:01] [debug] ESP+00000060: 007a2010 00775898 00000024 007a2034
[00:14:01] [debug] ESP+00000080: 02bd8990 007a1f38 007a2010 1005ff6f
[00:14:01] [debug] ESP+000000a0: 00770acc 0295ab00 02bdc9e4 fdb96d90
[00:14:01] [debug] ESP+000000c0: 6bde24f4 0019f638 00000010 000001f4
[00:14:01] [debug] ESP+000000e0: 007758bc 02bd8990 02bd8990 0019f838
[00:14:01] [debug] ESP+00000100: 0019f698 9fe17f7e 00000150 77440ec1
[00:14:01] [debug] ESP+00000120: 0019f7f4 02bdc9f0 0076f644 02bd8990
[00:14:01] [debug] ESP+00000140: 1007bc16 007a205c 02bd89e4 00000020
[00:14:01] [debug] ESP+00000160: 773bb135 00000026 00000020 00783af8
[00:14:01] [debug] ESP+00000180: 007a2034 007a1f38 02bd8994 00000020
[00:14:01] [debug] ESP+000001a0: 773bb135 00783f00 00000000 00000000
[00:14:01] [debug] ESP+000001c0: 00000000 00000002 00020000 000201c8
[00:14:01] [debug] ESP+000001e0: 00020bd0 0074b5f8 0019f770 773bae8e
[00:14:01] [debug] ESP+00000200: 00000014 1021cd28 0019f78c 751ea9f6
[00:14:01] [debug] ESP+00000220: 1021cd28 0072eaa8 1021cd28 00783878
[00:14:01] [debug] ESP+00000240: 101b2380 00000002 0019f808 10039012
[00:14:01] [debug] ESP+00000260: 1021cd28 0019f814 101b06cf 00783878
[00:14:01] [debug] ESP+00000280: 0295ab00 02bdc9d8 00000000 00000000
[00:14:01] [debug] ESP+000002a0: 6bdd37dd 0019f848 0019f84c 0074dae8
[00:14:01] [debug] ESP+000002c0: 1b383933 00770a00 00000000 0074b854
[00:14:01] [debug] ESP+000002e0: 0019f8b8 68075e76 00770acc 0295ab00
[00:14:01] [debug] ESP+00000300: 00000008 0295ab00 b61045ad 00000007
[00:14:01] [debug] ESP+00000320: 0073d000 1b3839d3 00000000 0295ab00
[00:14:01] [debug] ESP+00000340: 00770aa0 0019f8dc 6809452f ffffffff
[00:14:01] [debug] ESP+00000360: 02bdc9dc 6809a898 1b38398f 0295ab00
[00:14:01] [debug] ESP+00000380: 0019fa24 004010b6 0295ab00 02bdc9dc
[00:14:01] [debug] ESP+000003a0: 0019fa94 02bdc9dc 7597b1b3 000041b8
[00:14:01] [debug] ESP+000003c0: 00000000 000041d8 0000025c 00000008
[00:14:01] [debug] ESP+000003e0: 00000020 00000000 00700000 00000020

Used code

#include <a_samp>
#include <a_mysql>
#include <PawnPlus>

native mysql_tquery_s(MySQL:handle, AmxString:query, const callback[] = "", const format[] = "", {MySQL, Float,_}:...) = mysql_tquery;

new MySQL:Handle;

main()
{
	print("Test");
}

public OnGameModeInit()
{
	new MySQLOpt:options = mysql_init_options();
	mysql_set_option(options, AUTO_RECONNECT, true);
	mysql_set_option(options, MULTI_STATEMENTS, true);
	
	Handle = mysql_connect("localhost", "root", "", "testing", options);
	mysql_log(ALL);
	
	if(mysql_errno(Handle) == 0)
	{
	    new String:name = str_new("Heix"), String:ip = str_new("127.0.0.1");
	    mysql_tquery_s(Handle, str_format("SELECT * FROM `TEST` WHERE `NAME` = '%E' OR `IP` = '%E' LIMTI 1;", name, ip), "OnQueryFinish");
	}
	
	return 1;
}

forward OnQueryFinish();
public OnQueryFinish()
{
	new rows;
	if(cache_get_row_count(rows))
	{
	    if(rows) print("1");
	    else print("0");
	}
	
	return 1;
}

Incompatible with log-core

[log-core] fatal signal '11' (SIGSEGV) catched   

[debug] Server crashed due to an unknown error
[debug] Native backtrace:
[debug] #0 f7a05f7f in _Z13GetStackTraceRSt6vectorI10StackFrameSaIS0_EEPv () in plugins/crashdetect.so
[debug] #1 f79fe81d in _ZN11CrashDetect20PrintNativeBacktraceERSoRKN2os7ContextE () in plugins/crashdetect.so
[debug] #2 f79fee48 in _ZN11CrashDetect20PrintNativeBacktraceERKN2os7ContextE () in plugins/crashdetect.so
[debug] #3 f7a005dc in _ZN11CrashDetect7OnCrashERKN2os7ContextE () in plugins/crashdetect.so
[debug] #4 f7a0579f in ?? () in plugins/crashdetect.so
[debug] #5 f7f35570 in __kernel_rt_sigreturn () in linux-gate.so.1
[debug] #6 f7a03d35 in ?? () in plugins/crashdetect.so
[debug] #7 f75f6cda in ?? () in plugins/PawnPlus.so
[debug] #8 f7b60e69 in ?? () in /usr/lib32/libc.so.6
[debug] #9 f7b5dc76 in __nss_database_lookup2 () in /usr/lib32/libc.so.6
[debug] #10 f7b5ed61 in __nss_services_lookup2 () in /usr/lib32/libc.so.6
[debug] #11 f7b4eb02 in getservbyname_r () in /usr/lib32/libc.so.6
[debug] #12 f7b4e95b in getservbyname () in /usr/lib32/libc.so.6
[debug] #13 f712abfc in mysql_server_init () in plugins/mysql.so
[debug] #14 f711fed9 in Load () in plugins/mysql.so
[debug] #15 080d2742 in ?? () in samp03svr
[debug] #16 080d2afa in ?? () in samp03svr
[debug] #17 080aa0d0 in ?? () in samp03svr
[debug] #18 f7a4fa0d in __libc_start_main () in /usr/lib32/libc.so.6
[debug] #19 0804b4e1 in ?? () in samp03svr
[debug] Registers:
[debug] EAX: 09b7b700 EBX: 09ba6260 ECX: 00000004 EDX: 00000000
[debug] ESI: f7bc55ed EDI: f7bc896b EBP: 09b71fb0 ESP: ff9103f0
[debug] EIP: f7a03d35 EFLAGS: 00010286
[debug] Stack:
[debug] ESP+00000000: f75f7320 09b7b704 f77fd9c0 09b7bf88
[debug] ESP+00000020: f7bc896b f7bc55ed f7806000 f75f6ca9
[debug] ESP+00000040: 00000000 07b8bf53 f75f6c79 f7c1fe1c
[debug] ESP+00000060: f7bc896b f7bc55ed 63736e2f 6f732f64
[debug] ESP+00000080: ff91049c f7bc896b 01000000 00000000
[debug] ESP+000000a0: 00000000 00000000 00000000 00000184
[debug] ESP+000000c0: 00000000 60b95072 33a4ccb3 00000801
[debug] ESP+000000e0: 00000011 00000000 00000000 00000000
[debug] ESP+00000100: 00001000 00000008 00000000 60b95102
[debug] ESP+00000120: 07b8bf53 00000002 00000000 00000000
[debug] ESP+00000140: 00000000 00000000 00000000 00000000
[debug] ESP+00000160: 00000000 00000000 00000000 00000000
[debug] ESP+00000180: 00000000 00000000 00000001 53420e00
[debug] ESP+000001a0: f7c1fe1c f7bc88d5 0000000c f7b5dc76
[debug] ESP+000001c0: f70d15fe f7f42aad f70c6b38 f7c1fe1c
[debug] ESP+000001e0: f7bc88d5 00000000 00000000 f7c2377c
[debug] ESP+00000200: 00000400 f7198ff4 f7b5ed2d f7c1fe1c
[debug] ESP+00000220: ff910654 f7bc82f3 00000000 ff910658
[debug] ESP+00000240: 09b7d910 0000006e f7bc82f3 ff910658
[debug] ESP+00000260: 00000000 f70d15fe 00000005 53420e00
[debug] ESP+00000280: 00000400 f7198ff4 00000400 f7b4e95b
[debug] ESP+000002a0: 00000400 ff9106b8 00000000 00000000
[debug] ESP+000002c0: f7f4786d f73da48c 00000000 53420e00
[debug] ESP+000002e0: 00000000 f7450a6c ff910748 f712abfc
[debug] ESP+00000300: f73da48c 09b689a0 09b7c000 f711fed9
[debug] ESP+00000320: 0815ac90 f711fea6 0815ac90 080d2742
[debug] ESP+00000340: 00000000 0816330e 09b7c000 09b68705
[debug] ESP+00000360: 09b689a0 ff910770 ff9107d8 080a10af
[debug] ESP+00000380: 67756c70 2f736e69 7173796d 6f732e6c
[debug] ESP+000003a0: 00000000 00000000 00000000 09b6896c
[debug] ESP+000003c0: 09b65d00 09b68980 00000007 00000009
[debug] ESP+000003e0: ff910830 ff910840 ff910978 080a07e6
[debug] Loaded modules:
[debug] 00000000 - 00187f43 samp03svr
[debug] f7f35000 - f7f362ae linux-gate.so.1
[debug] f7f08000 - f7f0b11c /usr/lib32/libdl.so.2
[debug] f7ee6000 - f7f0568d /usr/lib32/libpthread.so.0
[debug] f7d15000 - f7ef32e7 /usr/lib32/libstdc++.so.6
[debug] f7c47000 - f7d12764 /usr/lib32/libm.so.6
[debug] f7c29000 - f7c44364 /usr/lib32/libgcc_s.so.1
[debug] f7a31000 - f7c2e910 /usr/lib32/libc.so.6
[debug] f7f37000 - f7f68913 /lib/ld-linux.so.2
[debug] f79e6000 - f7a2e3d4 plugins/crashdetect.so
[debug] f79b8000 - f79e7aa3 plugins/timerfix.so
[debug] f79ad000 - f79b585f /usr/lib32/librt.so.1
[debug] f78c4000 - f79aec83 plugins/YSF.so
[debug] f780d000 - f78c4cdf plugins/SKY.so
[debug] f7454000 - f78253ca plugins/PawnPlus.so
[debug] f70c3000 - f7458eb2 plugins/mysql.so
[debug] f709f000 - f70c2d32 /home/sage/Server/plugins/../log-core.so

Removing PawnPlus fixes the issue...

"dependencies": [
	"sampctl/samp-stdlib",
	"Zeex/samp-plugin-crashdetect:v4.20",
	"pawn-lang/YSI-Includes",
	"ziggi/samp-plugin-timerfix:v1.8",
	"IllidanS4/YSF:v2.1",
	"oscar-broman/samp-weapon-config",
	"IllidanS4/PawnPlus:v1.3.2",
	"pBlueG/SA-MP-MySQL:R41-4",
	"AGraber/pawn-plus-mysql",
	"AGraber/samp-async-dialogs"
],

Constant Iterators

Hello IllidanS4, I would like to ask if is there any way to create a constant iterator pointing to an element in dynamic container like this std::vector::cbegin() in C++?

I have a question

have a question is it possible with this plugin to detect these functions?

Float:vect3_length(Float:f[3])

{

return sqrtf(f[0] * f[0] + f[1] * f[1] + f[2] * f[2]);

}

Crash Ubuntu Ubuntu 20.04.6 LTS

In windows it works fine but in ubuntu it crashes
[13/08/2013 02:33:44] [Info] Loading plugin: PawnPlus-static
[13/08/2013 02:33:44] [Info] [debug] Server crashed due to an unknown error
[13/08/2013 02:33:44] [Info] [debug] Native backtrace:
[13/08/2013 02:33:44] [Info] [debug] #0 f3a4df7f in _Z13GetStackTraceRSt6vectorI10StackFrameSaIS0_EEPv () in plugins/crashdetect.so
[13/08/2013 02:33:44] [Info] [debug] #1 f3a4681d in _ZN11CrashDetect20PrintNativeBacktraceERSoRKN2os7ContextE () in plugins/crashdetect.so
[13/08/2013 02:33:44] [Info] [debug] #2 f3a46e48 in _ZN11CrashDetect20PrintNativeBacktraceERKN2os7ContextE () in plugins/crashdetect.so
[13/08/2013 02:33:44] [Info] [debug] #3 f3a485dc in _ZN11CrashDetect7OnCrashERKN2os7ContextE () in plugins/crashdetect.so
[13/08/2013 02:33:44] [Info] [debug] #4 f3a4d79f in ?? () in plugins/crashdetect.so
[13/08/2013 02:33:44] [Info] [debug] #5 f7f5ddc0 in __kernel_rt_sigreturn () in linux-gate.so.1
[13/08/2013 02:33:44] [Info] [debug] #6 f7f6bea0 in ?? () in /lib/ld-linux.so.2
[13/08/2013 02:33:44] [Info] [debug] #7 f7f73f3e in ?? () in /lib/ld-linux.so.2
[13/08/2013 02:33:44] [Info] [debug] #8 f7d372bb in _dl_catch_exception () in /lib/i386-linux-gnu/libc.so.6
[13/08/2013 02:33:44] [Info] [debug] #9 f7f738ba in ?? () in /lib/ld-linux.so.2
[13/08/2013 02:33:44] [Info] [debug] #10 f7f3a282 in ?? () in /lib/i386-linux-gnu/libdl.so.2
[13/08/2013 02:33:44] [Info] [debug] #11 f7d372bb in _dl_catch_exception () in /lib/i386-linux-gnu/libc.so.6
[13/08/2013 02:33:44] [Info] [debug] #12 f7d37394 in _dl_catch_error () in /lib/i386-linux-gnu/libc.so.6
[13/08/2013 02:33:44] [Info] [debug] #13 f7f39bf5 in ?? () in /lib/i386-linux-gnu/libdl.so.2
[13/08/2013 02:33:44] [Info] [debug] #14 f7f3a307 in dlopen () in /lib/i386-linux-gnu/libdl.so.2
[13/08/2013 02:33:44] [Info] [debug] #15 f4acde75 in ?? () in components/Pawn.so
[13/08/2013 02:33:44] [Info] [debug] #16 f4aceae3 in ?? () in components/Pawn.so
[13/08/2013 02:33:44] [Info] [debug] #17 f4ace74d in ?? () in components/Pawn.so
[13/08/2013 02:33:44] [Info] [debug] #18 f4b493bc in ?? () in components/Pawn.so
[13/08/2013 02:33:44] [Info] [debug] #19 08108500 in ?? () in ./omp-server
[13/08/2013 02:33:44] [Info] [debug] #20 08103780 in ?? () in ./omp-server
[13/08/2013 02:33:44] [Info] [debug] #21 f7c10ed5 in __libc_start_main () in /lib/i386-linux-gnu/libc.so.6
[13/08/2013 02:33:44] [Info] [debug] #22 080f3712 in ?? () in ./omp-server
[13/08/2013 02:33:44] [Info] [debug] Registers:
[13/08/2013 02:33:44] [Info] [debug] EAX: 00000000 EBX: 00000000 ECX: 00000000 EDX: 00000000
[13/08/2013 02:33:44] [Info] [debug] ESI: 00000001 EDI: f7f8b000 EBP: ffe89e58 ESP: ffe89dc0
[13/08/2013 02:33:44] [Info] [debug] EIP: f7f6bea0 EFLAGS: 00210246
[13/08/2013 02:33:44] [Info] [debug] Stack:
[13/08/2013 02:33:44] [Info] [debug] ESP+00000000: 145440b0 05019060 ac100c02 00220101
[13/08/2013 02:33:44] [Info] [debug] ESP+00000020: 00000001 6191e078 966c1160 03b9be04
[13/08/2013 02:33:44] [Info] [debug] ESP+00000040: 1041000a 97124118 00000000 09cd9e10
[13/08/2013 02:33:44] [Info] [debug] ESP+00000060: cb8b657e 00500900 08200400 c5c00966
[13/08/2013 02:33:44] [Info] [debug] ESP+00000080: 000000cc 00d9da00 f7f68c1d 00000000
[13/08/2013 02:33:44] [Info] [debug] ESP+000000a0: 09cd9e10 09cd9fd0 00000001 00000000
[13/08/2013 02:33:44] [Info] [debug] ESP+000000c0: ebdf97ac 9c06cdbc 00000000 01537d0e
[13/08/2013 02:33:44] [Info] [debug] ESP+000000e0: 00000040 00000001 09cd9e10 f7f8b970
[13/08/2013 02:33:44] [Info] [debug] ESP+00000100: 00000008 00000000 f7f8b000 d621eed8
[13/08/2013 02:33:44] [Info] [debug] ESP+00000120: f7bf4940 f7f8b544 ffe89ff0 f7d372bb
[13/08/2013 02:33:44] [Info] [debug] ESP+00000140: f7f8b544 3de00ec7 00000000 ffe89ff0
[13/08/2013 02:33:44] [Info] [debug] ESP+00000160: 09cd9908 ffe89f9c ffe89ff0 ffe89f24
[13/08/2013 02:33:44] [Info] [debug] ESP+00000180: ebde17ac 9c06cdbc 00000000 00000000
[13/08/2013 02:33:44] [Info] [debug] ESP+000001a0: ffe8a014 f7f69aa4 f7c0a329 00000000
[13/08/2013 02:33:44] [Info] [debug] ESP+000001c0: 00000000 f7f8b000 d62fef60 00000000
[13/08/2013 02:33:44] [Info] [debug] ESP+000001e0: f7f58f30 d62166a8 09cd9730 f7c77b6c
[13/08/2013 02:33:44] [Info] [debug] ESP+00000200: f7f8b544 00000001 d62ff350 16d93a00
[13/08/2013 02:33:44] [Info] [debug] ESP+00000220: ffe89ff0 f7f73c60 ffe89ffc 09cd9908
[13/08/2013 02:33:44] [Info] [debug] ESP+00000240: 80000001 f4acde75 09cd9e10 00000000
[13/08/2013 02:33:44] [Info] [debug] ESP+00000260: ffe8a0d4 d62166a8 d62ffbac ffe8a1fc
[13/08/2013 02:33:44] [Info] [debug] ESP+00000280: 09cdae20 80000001 f4acde75 fffffffe
[13/08/2013 02:33:44] [Info] [debug] ESP+000002a0: ffe8a228 f7f73810 00000001 80000001
[13/08/2013 02:33:44] [Info] [debug] ESP+000002c0: f7bf4940 08da196c 09cd9660 f7d372bb
[13/08/2013 02:33:44] [Info] [debug] ESP+000002e0: 000067e0 f7de1778 09cd9e08 ffe8a190
[13/08/2013 02:33:44] [Info] [debug] ESP+00000300: 00000200 00000000 ffe8a190 ffe8a0c4
[13/08/2013 02:33:44] [Info] [debug] ESP+00000320: eba2d7ac 9c06cdbc 00000000 00000074
[13/08/2013 02:33:44] [Info] [debug] ESP+00000340: 00000031 00000000 f7de1b10 0000005b
[13/08/2013 02:33:44] [Info] [debug] ESP+00000360: 08d28010 00bf4940 00000077 0000007c
[13/08/2013 02:33:44] [Info] [debug] ESP+00000380: 00000032 00000000 ffe8a228 f7de1740
[13/08/2013 02:33:44] [Info] [debug] ESP+000003a0: 00000003 09cd9e10 ffe8a1ac 16d93a00
[13/08/2013 02:33:44] [Info] [debug] ESP+000003c0: ffe8a190 f7f3a210 ffe8a1fc 08327bc7
[13/08/2013 02:33:44] [Info] [debug] ESP+000003e0: f7f3d000 08da1960 09cd9660 f7f39bf5
[13/08/2013 02:33:44] [Info] [debug] Loaded modules:
[13/08/2013 02:33:44] [Info] [debug] 00000000 - 004a788b omp-server
[13/08/2013 02:33:44] [Info] [debug] f7f5d000 - f7f5dfe2 linux-gate.so.1
[13/08/2013 02:33:44] [Info] [debug] f7f38000 - f7f3aeec /lib/i386-linux-gnu/libdl.so.2
[13/08/2013 02:33:44] [Info] [debug] f7f15000 - f7f357bf /lib/i386-linux-gnu/libpthread.so.0
[13/08/2013 02:33:44] [Info] [debug] f7f09000 - f7f11570 /lib/i386-linux-gnu/librt.so.1
[13/08/2013 02:33:44] [Info] [debug] f7e04000 - f7f07f08 /lib/i386-linux-gnu/libm.so.6
[13/08/2013 02:33:44] [Info] [debug] f7de5000 - f7e01978 /lib/i386-linux-gnu/libgcc_s.so.1
[13/08/2013 02:33:44] [Info] [debug] f7bf6000 - f7dea66a /lib/i386-linux-gnu/libc.so.6
[13/08/2013 02:33:44] [Info] [debug] f7f5f000 - f7f89fcb /lib/ld-linux.so.2
[13/08/2013 02:33:44] [Info] [debug] f73ae000 - f7681a71 components/LegacyNetwork.so
[13/08/2013 02:33:44] [Info] [debug] f7359000 - f73b270c components/Pickups.so
[13/08/2013 02:33:44] [Info] [debug] f5ef2000 - f5f4d0b4 components/Actors.so
[13/08/2013 02:33:44] [Info] [debug] f5d2a000 - f5eaf7e0 components/Databases.so
[13/08/2013 02:33:44] [Info] [debug] f5cd8000 - f5d2ec48 components/Classes.so
[13/08/2013 02:33:44] [Info] [debug] f5b61000 - f5ce839d components/Console.so
[13/08/2013 02:33:44] [Info] [debug] f5b0c000 - f5b65914 components/GangZones.so
[13/08/2013 02:33:44] [Info] [debug] f5590000 - f55edddc components/TextLabels.so
[13/08/2013 02:33:44] [Info] [debug] f54f7000 - f554abdc components/Checkpoints.so
[13/08/2013 02:33:44] [Info] [debug] f548e000 - f54ffd18 components/Vehicles.so
[13/08/2013 02:33:44] [Info] [debug] f5330000 - f537eebc components/Timers.so
[13/08/2013 02:33:44] [Info] [debug] f52c5000 - f5339648 components/Objects.so
[13/08/2013 02:33:44] [Info] [debug] f523d000 - f52cd9a8 components/Unicode.so
[13/08/2013 02:33:44] [Info] [debug] f505e000 - f5248e02 /lib/i386-linux-gnu/libstdc++.so.6
[13/08/2013 02:33:44] [Info] [debug] f500e000 - f506275c components/Dialogs.so
[13/08/2013 02:33:44] [Info] [debug] f4d80000 - f5068bd4 components/sampvoice.so
[13/08/2013 02:33:44] [Info] [debug] f49c1000 - f4dc9e0d components/Pawn.so
[13/08/2013 02:33:44] [Info] [debug] f4861000 - f49ce3d1 components/LegacyConfig.so
[13/08/2013 02:33:44] [Info] [debug] f480b000 - f48652ec components/Menus.so
[13/08/2013 02:33:44] [Info] [debug] f4600000 - f482ca74 components/pawnraknet.so
[13/08/2013 02:33:44] [Info] [debug] f45a6000 - f4605318 components/TextDraws.so
[13/08/2013 02:33:44] [Info] [debug] f431f000 - f44fe009 components/CustomModels.so
[13/08/2013 02:33:44] [Info] [debug] f42d0000 - f4323408 components/Variables.so
[13/08/2013 02:33:44] [Info] [debug] f4278000 - f42d4904 components/Fixes.so
[13/08/2013 02:33:44] [Info] [debug] f3a2e000 - f3a763d4 /mnt/sdb/Server/plugins/crashdetect.so
[13/08/2013 02:33:44] [Info] [debug] f7f41000 - f7f501d4 /mnt/sdb/Server/plugins/sscanf.so
[13/08/2013 02:33:44] [Info] [debug] d7161000 - d7509ac7 /mnt/sdb/Server/plugins/mysql.so
[13/08/2013 02:33:44] [Info] [debug] da0b7000 - da0c94bc /lib/i386-linux-gnu/libnss_files.so.2
[13/08/2013 02:33:44] [Info] [debug] d62fd000 - d6401f44 /mnt/sdb/Server/plugins/streamer.so
[13/08/2013 02:33:44] [Info] [debug] f3a21000 - f3a2d011 /mnt/sdb/Server/plugins/gvar.so
[13/08/2013 02:33:44] [Info] [debug] d620a000 - d63000e3 /mnt/sdb/Server/plugins/teamspeak-connector.so
[13/08/2013 02:33:44] [Info] [debug] d5cce000 - d6230708 /mnt/sdb/Server/plugins/PawnPlus-static.so

gta@srv95139-206152:~$ sestatus
SELinux status: disabled

SELinux is disabled please help me with this situation

Question about list_find

Hello,
For example, I have a list of arrays, want to find if which array index has item_id = 100. I'm thinking about using iterator, then get the whole array, then use if condition to check but I want to ask if there's a better way like using list_find or list_find_if. Thanks.

https://pastebin.com/MLptKVpV

LFN incompatibility

#include <a_samp>
#include <PawnPlus>

forward AVeryLongPublicFunctonThatExceeds32Characters();
public AVeryLongPublicFunctonThatExceeds32Characters()
{
    printf("test");
}

forward _pp@on_init@Testing();
public _pp@on_init@Testing()
{
    pawn_call_public(amx_encode_public(amx_public_index("AVeryLongPublicFunctonThatExceeds32Characters")), "");
}

main() {}

Fails with:

[PawnPlus] pawn_call_public: public function '������' was not found

In fact, it fails every time, even with a short public function name, if LFN is loaded.

How did you create a custom locale?

Hello, I've been told that you've created a custom locale.

I have been sent here from Stackoverflow: basic_regex throws bad_cast with char32_t

My goal is:

  1. Using std::basic_string<uint16_t>
  2. Use std::regex to find flags with <Pattern>
  3. In order to avoid writing a parser and reduce maintenance.

Methods of implementation:

  • create a custom locale in order to achieve this
  • use std::wregex instead
    • Messy & not straightforward, thus should not be considered the solution

I have been looking through your code and this is what I've gathered of what you are doing:

  1. typedef cell char_type
    • Defined as either const uchar or uchar in strings.cpp
  2. In namespace std
    • define
      • a hash method for some reason
      • iterators
      • a ctype of <cell> that inherits from locale::facet

I do not understand how to change this as there are no comments.

How can I use uint16_t instead of typedef cell?

samp-server.exe is not shut down correctly

#include <a_samp>
#include <PawnPlus>

main() {}

When typing exit on console or calling SendRconCommand("exit");, the result is:
Untitled

If I click on Debug, the result is:

The thread 0x... has exited with code 0 (0x0).
The thread 0x... has exited with code 3 (0x3).
The thread 0x... has exited with code 3 (0x3).
The program '[5928] samp-server.exe' has exited with code 3 (0x3).

I use Windows 7 Ultimate (SP1).

help please

I'm doing a samp server, and I put the PawnPlus include on my server, my host is linux, I uploaded PawnPlus.so, but this warning appears, I have no idea what it is. Also after a few minutes the server simply doesn't load the files, it's still online, but as if it were a "Blank Script"

[PawnPlus] Warning: amx_FindPublic returned negative index -10072 for function 'pp_on_error'. Possible collision with SAMPGDK detected. Use pp_public_min_index or pp_use_funcidx to remove this warning.
[PawnPlus] pool_add_arr: pool reference is invalid (value 0x0)

SAMPGDK negative index in amx_Exec causing stack underflow

Alright, i have the following plugins in my server.cfg PawnPlus mysql sscanf streamer but if i add PawnPlus to plugins list my login dialog dont work(wont apear at all) if i delete the PawnPlus from plugins the gamemode works perfect

If i add crashdetect too, after i connect to server this things pop out https://pastebin.com/bahkug22
If you need additional info just let me know

Note: I dont have PawnPlus included in my gamemode also i use the last version of your plugin

Edit: If i include PawnPlus in gamemode same thing occur

Cloned pools appear to have different indices from the original

I create an ordered pool to store material index data:

CreateMapMaterialPool(const name[MAX_MAP_NAME + 1], object_index)
{
    new
        Pool:p = pool_new(MAX_MAP_MATERIALS);

    pool_set_ordered(p, true);

    pool_set(GetAllMapMaterialPool(name), object_index, p);
}

When iterating through it:

// after adding 4 elements at indexes 1 - 4...
for_pool (i: GetMapMaterialPool(name, old_object_index))
{
    printf("original pool iter_get_key %d", iter_get_key(i));
}

new
    Pool:p = pool_clone(GetMapMaterialPool(name, old_object_index));

for_pool (i: p)
{
    printf("cloned pool iter_get_key %d", iter_get_key(i));
}
[run-dev] original pool iter_get_key 1
[run-dev] original pool iter_get_key 2
[run-dev] original pool iter_get_key 3
[run-dev] original pool iter_get_key 4
[run-dev] cloned pool iter_get_key 0
[run-dev] cloned pool iter_get_key 1
[run-dev] cloned pool iter_get_key 2
[run-dev] cloned pool iter_get_key 3

My understanding is that the cloned pool should have the same indices as the original one.

"Ref-counting" in the global pool

The issue

Currently, functions like str_to_global and str_to_local simply move the string between the two pools. However, let's have a situation like this:

stock Func(String:str, delay)
{
    amx_forked(fork_data, .use_data = false)
    {
        str_to_global(str);
        wait_ms(delay);
        str_to_local(str);
        print_s(str);
    }
}

Moving the string to the global pool is necessary, because if the string was local, the GC would delete it before the code is resumed. However, this causes issues when the same string is used:

new String:str = str_new_static("string");
Func(str, 1000);
Func(str, 1500);

Since both functions are called at the same time, by the time the second one is resumed, the string has been already collected, because during the wait, it is moved back to the local pool.

This problem cannot be solved without storing additional information about the string, but this makes the code more complicated.

The proposal

I propose a breaking change to how the global pool works. Instead of simple operations like to_local and to_global, new operations would be introduced: use and release. The functions would manipulate the internal "reference count" every GC-object has. When the count is increased from 0, the object would be moved to the global pool. When the count is decreased from 1, the object would be moved to the local pool. Decreasing the count from 0 would produce a warning.

The GC will behave in the same way: objects in the local pool will be collected when the current supercontext is released (i.e. at the end of the top-level callback).

Together with this change, the global versions of the tags will be removed as well, since every individual function can handle the ownership of the string on its own, if it needs to. As a result, deleting a string will be always almost unneeded, because if the counts of use and release are balanced, the GC will automatically delete it eventually.

Guards

Guards would be modified to use the use and release operations by default, instead of delete. Thanks to this, the function above could be rewritten like this:

stock Func(String:str, delay)
{
    amx_forked(fork_data, .use_data = false)
    {
        pawn_guard(str);
        wait_ms(delay);
        print_s(str);
    }
}

pawn_guard will call use on str when used, increasing the count by 1. Since the guard will remain alive during the whole forked context, the string cannot be collected. Once the context ands, the guard will be destroyed and as a result, release is called on str. If nothing else owns the string, it will be collected.

Collections

At the moment, storing dynamic strings in collections is simple: move it to the global pool and add it to the collection. Calling list_delete_deep and similar functions will destroy the string stored inside.

I think list_delete_deep should instead call release on the string, decreasing the reference count. This makes sharing the same string in multiple containers very easy, since you only need to call str_use (as you would have used str_to_global previously) before storing the string in a container, and list_delete_deep would make it be deleted eventually.

The only slight issue is with variant references stored inside containers. Previously, the function would have called var_delete_deep on the variant (recursively deleting its contents), but since it should behave the same way for any GC-object, it would call release on it, and the GC will then delete the variant without deleting its contents.

Since variants should be only used for passing dynamic values around, I guess this is not such a large issue for most users. In addition, there might be another type of GC-object added in the future that would solve this.

The impact

  • GlobalString, GlobalVariant, and GlobalIter tags are removed.
  • *_to_global functions removed, *_use is introduced.
  • *_to_local functions removed, *_release is introduced.
  • tag_op_delete_deep (free in C++) renamed to tag_op_release. Retains its effect for non-GC-collected objects, but decreases the reference count for GC-objects.
  • tag_op_use introduced. Increases the reference count for GC-objects. Does nothing for other objects.
  • var_delete_deep removed (to reduce confusion and enforce proper usage). Variant references stored in collections will not be recursively deleted when the collection is recursively deleted.

Since this is quite a significant change to how a part of this plugin works (albeit one I consider beneficial), I have decided to first introduce it in this manner, for others to discuss and add their own insights.

Performance issue? SendClientMessageToAllStr vs SendClientMessageToAll

Why is using SendClientMessageToAllStr() is a bit slower than using SendClientMessageToAll() ?
The difference is about ~60ms

SendClientMessageToAll

   new string[48];
   format(string, 48, "Test. Test. Test. Test. Test. Test. Test. Test.");
   new startTick, stopTick;
   startTick = GetTickCount();
   for (new i; i < 1000000; i ++)
   {
      SendClientMessageToAll(-1, string);
   }
   stopTick = GetTickCount();
   printf("------ %i ms -------", stopTick - startTick);

Result: 802 ms

SendClientMessageToAllStr

   new String:string = str_new("Test. Test. Test. Test. Test. Test. Test. Test.");
   new startTick, stopTick;
   startTick = GetTickCount();
   for (new i; i < 1000000; i ++)
   {
      SendClientMessageToAllStr(-1, string);
   }
   stopTick = GetTickCount();
   printf("------ %i ms -------", stopTick - startTick);

Result: 857 ms

Platform

Hardware: Intel x64
OS: Windows 7 32bit
PAWN: 3.10.8
Compile arguments: -d0 -O1 -v3
SAMP: 0.3.7 R

undefined symbol "await"

Hi.

I'm using sampctl and installed your plugin to use tasks!

The problem is when I'm trying to build the project it fails with an error says:
'(error) undefined symbol "await"'

Any ideas why this might happen and how to fix it?

Thanks!

Errorduring compilation

I ensure my sampctl proyect, dont change any version of any plugin, only update YSI Include and the copiler start to trow errors, yesterday y uses all normaly.

The errors are:

/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:697 (error) undefined symbol "arg0"
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:697 (error) expected token: ";", but found ","
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:721 (error) undefined symbol "arg0"
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:721 (error) expected token: ";", but found ","
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:841 (error) undefined symbol "arg0"
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:841 (error) expected token: ";", but found ","
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:847 (error) undefined symbol "arg0"
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:847 (error) expected token: ";", but found ","
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:853 (error) undefined symbol "arg0"
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:853 (error) expected token: ";", but found ","
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:859 (error) undefined symbol "arg1"
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:859 (error) expected token: ";", but found ","
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:867 (error) undefined symbol "arg1"
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:867 (error) expected token: ";", but found ","
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:904 (error) undefined symbol "arg0"
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:904 (error) expected token: ";", but found ","
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:910 (error) undefined symbol "arg0"
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:910 (error) expected token: ";", but found ","
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:916 (error) undefined symbol "arg0"
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:916 (error) expected token: ";", but found ","
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:922 (error) undefined symbol "arg1"
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:922 (error) expected token: ";", but found ","
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:930 (error) undefined symbol "arg1"
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:930 (error) expected token: ";", but found ","
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:1118 (error) undefined symbol "arg0"
/home/sopa/MalosAiresRolePlay/dependencies/PawnPlus/pawno/include/PawnPlus.inc:1118 (error) expected token: ";", but found ","

I try to update to 1.4 but this persist, also happens in windows.

Return codes or AMX errors?

The title says it all. The issue is whether functions that are given invalid parameters should raise an error or return a special error code.

At the moment, AMX errors are raised only when a function is called with an invalid format of arguments. Unpaired keys and values for map construction, argument format strings with invalid number of arguments, or calling a function with less arguments provided than required.

In my opinion, raising an AMX error is appropriate on these occasions, since the error comes from incorrect explicit usage of the function, and can be understood and fixed by working only with the line of the call. Other natives return special values signaling failure whenever possible (usually 0 or -1).

However, based on my experience, error codes are rarely checked by programmers, and therefore aren't a reliable way to inform the programmer in the majority of cases.

Imagine this function:

List:GetListOfSomething()
{
    new List:l; // list_new() is forgotten
    list_add(l, 3);
    list_add(l, 1);
    list_add(l, 4);
    return l;
}

Adding to a nonexistent list is certainly a failure, and thus list_add returns -1, signalling an error. However, one does not usually catch this error, and most importantly, one cannot recover from this error in any sensible way.

Imagine the function was supposed to return a list of houses the player has bought. The mistake can be easily missed, and with lack of proper testing, it can erase the houses of all players, before being discovered.

In my opinion, when this kind of error happens, the code should "fail fast", which is certainly better than continuing execution in an unexpected and undesired state, since most likely, the error will be completely ignored, cascading into other errors further in the code.

So, my proposal is to get rid of return codes, and raise AMX errors for errors that satisfy all of the following:

  • The observable result of the function call is not the desirable one (e.g. list_add didn't add a value, list_get didn't get the value).
  • The error can be easily prevented by checking the state of the program or the arguments (e.g. passing an invalid argument, be it an object reference or an offset).
  • The return code is indistinguishable from a normal value, or it makes no sense to recover from the error.

Perhaps there errors can be better described by what Eric Lippert calls boneheaded exceptions.

In all these cases, an AMX error would be raised with the code representing the invalid operation, and an informative message would be printed. Hopefully, this would be caught during the testing of any script.

If such an error gets into production, PawnPlus already offers ways to catch it, if it is needed. There is task_bind and amx_fork that can get the AMX error code, so the programmer can decide whether to shut down the server, or simply print an error message to the player (if it is not that fatal).

Since this is once again a breaking change, albeit what I find a useful one, I want first to discuss it with you, to share thoughts and opinions.

amx_fork/threaded crash [Linux]

Hey again, not quite sure what the issue here is, but;

I've been looking through the documentation examples and have tried a few. A few work and a few just crash the plugin (server).

Tried using this in a command;

new result;
amx_forked(.result=result)
{
    task_yield(1);
    threaded(sync_explicit)
    {
        thread_sleep(1000);
        print("Thread end");
    }
    print("Fork end"); //after 1 s
}
assert result == 1; //immediately

And I get a crash error;

[01:54:23] [debug] Server crashed due to an unknown error
[01:54:23] [debug] Native backtrace:
[01:54:23] [debug] #0 f72e2371 in _Z13GetStackTraceRSt6vectorI10StackFrameSaIS0_EEPv () from plugins/crashdetect.so
[01:54:23] [debug] #1 f72d996d in _ZN18CrashDetectHandler20PrintNativeBacktraceERSoRKN2os7ContextE () from plugins/crashdetect.so
[01:54:23] [debug] #2 f72da98d in _ZN18CrashDetectHandler20PrintNativeBacktraceERKN2os7ContextE () from plugins/crashdetect.so
[01:54:23] [debug] #3 f72dcd1d in _ZN18CrashDetectHandler7OnCrashERKN2os7ContextE () from plugins/crashdetect.so
[01:54:23] [debug] #4 f72e183c in ?? () from plugins/crashdetect.so
[01:54:23] [debug] #5 f76efbd0 in ?? ()
[01:54:23] [debug] #6 f72dc6aa in _ZN18CrashDetectHandler13HandleAMXExecEPii () from plugins/crashdetect.so
[01:54:23] [debug] #7 f72df999 in ?? () from plugins/crashdetect.so
[01:54:23] [debug] #8 f5964406 in ?? () from plugins/streamer.so
[01:54:23] [debug] #9 f564744c in _Z15amx_ExecContextP6tagAMXPiibPN3amx5resetEb () from plugins/PawnPlus.so
[01:54:23] [debug] #10 f5649154 in _Z15amx_ExecContextP6tagAMXPiibPN3amx5resetEb () from plugins/PawnPlus.so
[01:54:23] [debug] #11 f564b9e6 in _ZN5Hooks8amx_ExecEP6tagAMXPii () from plugins/PawnPlus.so
[01:54:23] [debug] #12 706f7264 in ?? () from D��

Tests

Since the plugin isn't really bound to players (or even SA-MP, given a proper compatible runtime that loads plugins as expected), it would be ideal to have some tests to ensure that everything is working properly and checking that nothing breaks with time, since that's been the case with some sensitive features like callback registering and native hooking/calling.

I'll do some when I can, but I thought it would be ideal to have this written down somewhere.

List of tasks as a parameter in `task_all`

Hi @IllidanS4,

The current task_all implementation uses rest parameter for passing a number of tasks.

I would love to request a feature that you can pass a list (or any other dynamic containers) of tasks to task_all as a parameter, not a rest one.

This is super useful when we work with loops, for example:

new Task:tasks[100];
for(new i = 0; i != sizeof tasks; ++i) {
	tasks[i] = task_new();
	task_set_result_ms(tasks[i], 1, 1000);
}
await task_all(tasks);
for(new i = 0; i != sizeof tasks; ++i) {
	task_delete(tasks[i]);
}
new List:listOfTasks = list_new();
for(new i = 0; i != 100; ++i) {
	new Task:t = task_new();
	task_set_result_ms(t, 1, 1000);
	list_add(listOfTasks, t);
}
await task_all(listOfTasks);
list_clear_deep(listOfTasks);

Linux crash

Hi, I've tried PawnPlus.so and PawnPlus-static.so from the release page but getting a crash, also I tried to compile it on my server, but still getting the same output

[19:26:29]  Loading plugin: PawnPlus.so
[19:26:29] [debug] Server crashed due to an unknown error
[19:26:29] [debug] Native backtrace:
[19:26:29] [debug] #0 f7acf8b6 in _Z13GetStackTraceRSt6vectorI10StackFrameSaIS0_EEPv () in plugins/crashdetect.so
[19:26:29] [debug] #1 f7ac7120 in _ZN18CrashDetectHandler20PrintNativeBacktraceERSoRKN2os7ContextE () in plugins/crashdetect.so
[19:26:29] [debug] #2 f7ac7886 in _ZN18CrashDetectHandler20PrintNativeBacktraceERKN2os7ContextE () in plugins/crashdetect.so
[19:26:29] [debug] #3 f7ac7f96 in _ZN18CrashDetectHandler7OnCrashERKN2os7ContextE () in plugins/crashdetect.so
[19:26:29] [debug] #4 f7acef82 in ?? () in plugins/crashdetect.so
[19:26:29] [debug] #5 f7f56070 in __kernel_rt_sigreturn () in linux-gate.so.1
[19:26:29] [debug] #6 f5d69045 in subhook_install () in plugins/PawnPlus.so
[19:26:29] [debug] #7 f5cbe8f8 in _ZN5Hooks8RegisterEv () in plugins/PawnPlus.so
[19:26:29] [debug] #8 f5cf9540 in Load () in plugins/PawnPlus.so
[19:26:29] [debug] #9 080d2742 in ?? () in ./samp03svr
[19:26:29] [debug] #10 080d2afa in ?? () in ./samp03svr
[19:26:29] [debug] #11 080aa0d0 in ?? () in ./samp03svr
[19:26:29] [debug] #12 f7b114d9 in __libc_start_main () in /lib/libc.so.6
[19:26:29] [debug] #13 0804b4e1 in ?? () in ./samp03svr
[19:26:29] [debug] Registers:
[19:26:29] [debug] EAX: 00000000 EBX: f5e64000 ECX: 00000000 EDX: f5e69b78
[19:26:29] [debug] ESI: f5e69618 EDI: 0a09fe40 EBP: ffb467f8 ESP: ffb46798
[19:26:29] [debug] EIP: f5d69045 EFLAGS: 00010296
[19:26:29] [debug] Stack:
[19:26:29] [debug] ESP+00000000: f5e64000 f5cbe8f8 00000000 f5cc0770
[19:26:29] [debug] ESP+00000020: f5e69b8c f5cf9540 f5cf94f7 0815abd0
[19:26:29] [debug] ESP+00000040: ffb46930 f7b798ef ffb46820 ffb46930
[19:26:29] [debug] ESP+00000060: ffb46a58 080d2afa 0a08d9a0 ffb46820
[19:26:29] [debug] ESP+00000080: 00000000 0a08d9a0 67756c70 2f736e69
[19:26:29] [debug] ESP+000000a0: 6f732e63 00000000 00000000 00000000
[19:26:29] [debug] ESP+000000c0: 00000000 ffb468f0 0a08ace0 0a08d980
[19:26:29] [debug] ESP+000000e0: 00000007 0a08d940 ffb468e0 ffb468f0
[19:26:29] [debug] ESP+00000100: ffb468f0 f7e05efc 0a08d850 f7c9b000
[19:26:29] [debug] ESP+00000120: f7f1ca04 f7e504ac 0a08d980 00000001
[19:26:29] [debug] ESP+00000140: 0a08d850 0809fbc4 0a08d96c ffb46900
[19:26:29] [debug] ESP+00000160: ffb46940 0a08bc40 0a08d980 00000101
[19:26:29] [debug] ESP+00000180: 00000000 00000000 00000000 00000000
[19:26:29] [debug] ESP+000001a0: 00000000 00000000 00000000 00000000
[19:26:29] [debug] ESP+000001c0: 00000000 00000000 00000000 00000a00
[19:26:29] [debug] ESP+000001e0: 00000ec0 0a08d998 000004bc 00000a00
[19:26:29] [debug] ESP+00000200: 00000120 0000012c 00000044 00000000
[19:26:29] [debug] ESP+00000220: 00000002 00000007 00000000 0a08513c
[19:26:29] [debug] ESP+00000240: 00000000 00000077 0000004d 00000013
[19:26:29] [debug] ESP+00000260: 00000000 f7c9b000 000004bc 000004bf
[19:26:29] [debug] ESP+00000280: 00000009 0a08d930 00000003 00000002
[19:26:29] [debug] ESP+000002a0: ffb46b98 f7e084ab 000004bc 00000000
[19:26:29] [debug] ESP+000002c0: ffb46b98 080aa0d0 0a08d9a0 08159c2b
[19:26:29] [debug] ESP+000002e0: f7f1c454 00000000 ffb46a98 f7eb18ba
[19:26:29] [debug] ESP+00000300: f7f1fcb4 01008460 00010100 00001e61
[19:26:29] [debug] ESP+00000320: 08003531 f7e788a0 f7f1ca04 f7f1ca04
[19:26:29] [debug] ESP+00000340: f7b28f6d f7c9e588 f7c9b000 00000000
[19:26:29] [debug] ESP+00000360: 00000000 00000000 00000000 00000000
[19:26:29] [debug] ESP+00000380: 00000000 00000000 00000000 00000000
[19:26:29] [debug] ESP+000003a0: 00000000 00000000 00000000 00000000
[19:26:29] [debug] ESP+000003c0: 00000000 00000000 00000000 00000000
[19:26:29] [debug] ESP+000003e0: f7f7ffb4 f7b29149 f7f67970 00000000
[19:26:29] [debug] Loaded modules:
[19:26:29] [debug] 00000000 - 00187dc3 samp03svr
[19:26:29] [debug] f7f55000 - f7f56246 linux-gate.so.1
[19:26:29] [debug] f7f42000 - f7f44f30 /lib/libdl.so.2
[19:26:29] [debug] f7f21000 - f7f4069b /lib/libpthread.so.0
[19:26:29] [debug] f7d8e000 - f7f2cb1c /lib/libstdc++.so.6
[19:26:29] [debug] f7cbc000 - f7d8d52c /lib/libm.so.6
[19:26:29] [debug] f7c9f000 - f7cba594 /lib/libgcc_s.so.1
[19:26:29] [debug] f7af7000 - f7ca551f /lib/libc.so.6
[19:26:29] [debug] f7f57000 - f7f8078c /lib/ld-linux.so.2
[19:26:29] [debug] f7ab0000 - f7af43ac plugins/crashdetect.so
[19:26:29] [debug] f771f000 - f7ab4eb2 plugins/mysql.so
[19:26:29] [debug] f76fb000 - f771ed32 /home/games/samp/test_server/samp03/plugins/../log-core.so
[19:26:29] [debug] f76f1000 - f76f9020 /lib/librt.so.1
[19:26:29] [debug] f66db000 - f66ed488 /lib/libnss_files.so.2
[19:26:29] [debug] f661d000 - f66db39a plugins/streamer.so
[19:26:29] [debug] f660d000 - f661c40c plugins/sscanf.so
[19:26:29] [debug] f641b000 - f65033e9 plugins/pawncmd.so
[19:26:29] [debug] f6332000 - f641e778 plugins/pawnregex.so
[19:26:29] [debug] f630c000 - f63303cd plugins/SKY.so
[19:26:29] [debug] f61ff000 - f630d79b plugins/ColAndreas_static.so
[19:26:29] [debug] f5ab2000 - f5e829c6 plugins/PawnPlus.so

"task" conflict with y_timers

Some functions have "Task:task" as parameters. It creates conflicts with y_timer "task" keyword.
Would be good if names get changed.

Other hooks not called when task in OnPlayerConnect hook

Hey there, so I ran into another problem. I have a modular gamemode and work with a lot of hooks. Normally I do not run into problems with this, but found that when I indirectly add a task to a OnPlayerConnect hook through a callback (which from what I understand from your documentation should pause that particular callback and not OnPlayerConnect), the code from other hooks are no longer being executed.

However, if I move the code from another hook into this hook, it will.

And if I get rid of the PawnPlus task, then other hooks get called fine.

Here is an example code. I use y_hooks for hooking and include y_hooks in each include that uses it as well (as you should).

hook OnPlayerConnect(playerid)
{
	CallLocalFunction(#welcomePlayer, "d", playerid);
	return 1;
}

forward welcomePlayer(playerid);
public welcomePlayer(playerid)
{
	wait_ms(2000);
	return 1;
}

This code in another hook (in another file) doesn't get executed while it should.

#include <YSI\y_hooks>

hook OnPlayerConnect(playerid)
{
    TogglePlayerSpectating(playerid, 1);
    PlayAudioStreamForPlayer(playerid, "http://127.0.0.1/alrp/serverintro.mp3");
	switch(random(2))
	{
		case 0: // Angel Pine North Gas Station
		{
		    SetPlayerPos(playerid, -1508.2727, -2991.9058, 0.0);
			SetPlayerCameraPos(playerid, -1508.2727, -2991.9058, 93.6866);
			SetPlayerCameraLookAt(playerid, -1508.5916, -2990.9526, 93.5015);
 			InterpolateCameraPos(playerid, -1508.2727, -2991.9058, 93.6866, -1717.8026, -2789.3159, 121.2620, 60000, CAMERA_MOVE);
			InterpolateCameraLookAt(playerid, -1508.5916, -2990.9526, 93.5015, -1716.9001, -2788.8755, 120.8320, 60000, CAMERA_MOVE);
		}
		case 1: // Flint County Farm
		{
		    SetPlayerPos(playerid, -269.4498, -1614.9242, 0.0);
			SetPlayerCameraPos(playerid, -269.4498, -1614.9242, 58.0998);
			SetPlayerCameraLookAt(playerid, -270.2507, -1614.3184, 57.8497);
 			InterpolateCameraPos(playerid, -269.4498, -1614.9242, 58.0998, -255.4192, -1487.0031, 50.0984, 60000, CAMERA_MOVE);
			InterpolateCameraLookAt(playerid, -270.2507, -1614.3184, 57.8497, -256.3769, -1486.7010, 50.0233, 60000, CAMERA_MOVE);
		}
	}
    return 1;
}

Crash Ubuntu

En windows trabaja bien pero en ubuntu da crash
[13/08/2013 02:33:44] [Info] Loading plugin: PawnPlus-static
[13/08/2013 02:33:44] [Info] [debug] Server crashed due to an unknown error
[13/08/2013 02:33:44] [Info] [debug] Native backtrace:
[13/08/2013 02:33:44] [Info] [debug] #0 f3a4df7f in _Z13GetStackTraceRSt6vectorI10StackFrameSaIS0_EEPv () in plugins/crashdetect.so
[13/08/2013 02:33:44] [Info] [debug] #1 f3a4681d in _ZN11CrashDetect20PrintNativeBacktraceERSoRKN2os7ContextE () in plugins/crashdetect.so
[13/08/2013 02:33:44] [Info] [debug] #2 f3a46e48 in _ZN11CrashDetect20PrintNativeBacktraceERKN2os7ContextE () in plugins/crashdetect.so
[13/08/2013 02:33:44] [Info] [debug] #3 f3a485dc in _ZN11CrashDetect7OnCrashERKN2os7ContextE () in plugins/crashdetect.so
[13/08/2013 02:33:44] [Info] [debug] #4 f3a4d79f in ?? () in plugins/crashdetect.so
[13/08/2013 02:33:44] [Info] [debug] #5 f7f5ddc0 in __kernel_rt_sigreturn () in linux-gate.so.1
[13/08/2013 02:33:44] [Info] [debug] #6 f7f6bea0 in ?? () in /lib/ld-linux.so.2
[13/08/2013 02:33:44] [Info] [debug] #7 f7f73f3e in ?? () in /lib/ld-linux.so.2
[13/08/2013 02:33:44] [Info] [debug] #8 f7d372bb in _dl_catch_exception () in /lib/i386-linux-gnu/libc.so.6
[13/08/2013 02:33:44] [Info] [debug] #9 f7f738ba in ?? () in /lib/ld-linux.so.2
[13/08/2013 02:33:44] [Info] [debug] #10 f7f3a282 in ?? () in /lib/i386-linux-gnu/libdl.so.2
[13/08/2013 02:33:44] [Info] [debug] #11 f7d372bb in _dl_catch_exception () in /lib/i386-linux-gnu/libc.so.6
[13/08/2013 02:33:44] [Info] [debug] #12 f7d37394 in _dl_catch_error () in /lib/i386-linux-gnu/libc.so.6
[13/08/2013 02:33:44] [Info] [debug] #13 f7f39bf5 in ?? () in /lib/i386-linux-gnu/libdl.so.2
[13/08/2013 02:33:44] [Info] [debug] #14 f7f3a307 in dlopen () in /lib/i386-linux-gnu/libdl.so.2
[13/08/2013 02:33:44] [Info] [debug] #15 f4acde75 in ?? () in components/Pawn.so
[13/08/2013 02:33:44] [Info] [debug] #16 f4aceae3 in ?? () in components/Pawn.so
[13/08/2013 02:33:44] [Info] [debug] #17 f4ace74d in ?? () in components/Pawn.so
[13/08/2013 02:33:44] [Info] [debug] #18 f4b493bc in ?? () in components/Pawn.so
[13/08/2013 02:33:44] [Info] [debug] #19 08108500 in ?? () in ./omp-server
[13/08/2013 02:33:44] [Info] [debug] #20 08103780 in ?? () in ./omp-server
[13/08/2013 02:33:44] [Info] [debug] #21 f7c10ed5 in __libc_start_main () in /lib/i386-linux-gnu/libc.so.6
[13/08/2013 02:33:44] [Info] [debug] #22 080f3712 in ?? () in ./omp-server
[13/08/2013 02:33:44] [Info] [debug] Registers:
[13/08/2013 02:33:44] [Info] [debug] EAX: 00000000 EBX: 00000000 ECX: 00000000 EDX: 00000000
[13/08/2013 02:33:44] [Info] [debug] ESI: 00000001 EDI: f7f8b000 EBP: ffe89e58 ESP: ffe89dc0
[13/08/2013 02:33:44] [Info] [debug] EIP: f7f6bea0 EFLAGS: 00210246
[13/08/2013 02:33:44] [Info] [debug] Stack:
[13/08/2013 02:33:44] [Info] [debug] ESP+00000000: 145440b0 05019060 ac100c02 00220101
[13/08/2013 02:33:44] [Info] [debug] ESP+00000020: 00000001 6191e078 966c1160 03b9be04
[13/08/2013 02:33:44] [Info] [debug] ESP+00000040: 1041000a 97124118 00000000 09cd9e10
[13/08/2013 02:33:44] [Info] [debug] ESP+00000060: cb8b657e 00500900 08200400 c5c00966
[13/08/2013 02:33:44] [Info] [debug] ESP+00000080: 000000cc 00d9da00 f7f68c1d 00000000
[13/08/2013 02:33:44] [Info] [debug] ESP+000000a0: 09cd9e10 09cd9fd0 00000001 00000000
[13/08/2013 02:33:44] [Info] [debug] ESP+000000c0: ebdf97ac 9c06cdbc 00000000 01537d0e
[13/08/2013 02:33:44] [Info] [debug] ESP+000000e0: 00000040 00000001 09cd9e10 f7f8b970
[13/08/2013 02:33:44] [Info] [debug] ESP+00000100: 00000008 00000000 f7f8b000 d621eed8
[13/08/2013 02:33:44] [Info] [debug] ESP+00000120: f7bf4940 f7f8b544 ffe89ff0 f7d372bb
[13/08/2013 02:33:44] [Info] [debug] ESP+00000140: f7f8b544 3de00ec7 00000000 ffe89ff0
[13/08/2013 02:33:44] [Info] [debug] ESP+00000160: 09cd9908 ffe89f9c ffe89ff0 ffe89f24
[13/08/2013 02:33:44] [Info] [debug] ESP+00000180: ebde17ac 9c06cdbc 00000000 00000000
[13/08/2013 02:33:44] [Info] [debug] ESP+000001a0: ffe8a014 f7f69aa4 f7c0a329 00000000
[13/08/2013 02:33:44] [Info] [debug] ESP+000001c0: 00000000 f7f8b000 d62fef60 00000000
[13/08/2013 02:33:44] [Info] [debug] ESP+000001e0: f7f58f30 d62166a8 09cd9730 f7c77b6c
[13/08/2013 02:33:44] [Info] [debug] ESP+00000200: f7f8b544 00000001 d62ff350 16d93a00
[13/08/2013 02:33:44] [Info] [debug] ESP+00000220: ffe89ff0 f7f73c60 ffe89ffc 09cd9908
[13/08/2013 02:33:44] [Info] [debug] ESP+00000240: 80000001 f4acde75 09cd9e10 00000000
[13/08/2013 02:33:44] [Info] [debug] ESP+00000260: ffe8a0d4 d62166a8 d62ffbac ffe8a1fc
[13/08/2013 02:33:44] [Info] [debug] ESP+00000280: 09cdae20 80000001 f4acde75 fffffffe
[13/08/2013 02:33:44] [Info] [debug] ESP+000002a0: ffe8a228 f7f73810 00000001 80000001
[13/08/2013 02:33:44] [Info] [debug] ESP+000002c0: f7bf4940 08da196c 09cd9660 f7d372bb
[13/08/2013 02:33:44] [Info] [debug] ESP+000002e0: 000067e0 f7de1778 09cd9e08 ffe8a190
[13/08/2013 02:33:44] [Info] [debug] ESP+00000300: 00000200 00000000 ffe8a190 ffe8a0c4
[13/08/2013 02:33:44] [Info] [debug] ESP+00000320: eba2d7ac 9c06cdbc 00000000 00000074
[13/08/2013 02:33:44] [Info] [debug] ESP+00000340: 00000031 00000000 f7de1b10 0000005b
[13/08/2013 02:33:44] [Info] [debug] ESP+00000360: 08d28010 00bf4940 00000077 0000007c
[13/08/2013 02:33:44] [Info] [debug] ESP+00000380: 00000032 00000000 ffe8a228 f7de1740
[13/08/2013 02:33:44] [Info] [debug] ESP+000003a0: 00000003 09cd9e10 ffe8a1ac 16d93a00
[13/08/2013 02:33:44] [Info] [debug] ESP+000003c0: ffe8a190 f7f3a210 ffe8a1fc 08327bc7
[13/08/2013 02:33:44] [Info] [debug] ESP+000003e0: f7f3d000 08da1960 09cd9660 f7f39bf5
[13/08/2013 02:33:44] [Info] [debug] Loaded modules:
[13/08/2013 02:33:44] [Info] [debug] 00000000 - 004a788b omp-server
[13/08/2013 02:33:44] [Info] [debug] f7f5d000 - f7f5dfe2 linux-gate.so.1
[13/08/2013 02:33:44] [Info] [debug] f7f38000 - f7f3aeec /lib/i386-linux-gnu/libdl.so.2
[13/08/2013 02:33:44] [Info] [debug] f7f15000 - f7f357bf /lib/i386-linux-gnu/libpthread.so.0
[13/08/2013 02:33:44] [Info] [debug] f7f09000 - f7f11570 /lib/i386-linux-gnu/librt.so.1
[13/08/2013 02:33:44] [Info] [debug] f7e04000 - f7f07f08 /lib/i386-linux-gnu/libm.so.6
[13/08/2013 02:33:44] [Info] [debug] f7de5000 - f7e01978 /lib/i386-linux-gnu/libgcc_s.so.1
[13/08/2013 02:33:44] [Info] [debug] f7bf6000 - f7dea66a /lib/i386-linux-gnu/libc.so.6
[13/08/2013 02:33:44] [Info] [debug] f7f5f000 - f7f89fcb /lib/ld-linux.so.2
[13/08/2013 02:33:44] [Info] [debug] f73ae000 - f7681a71 components/LegacyNetwork.so
[13/08/2013 02:33:44] [Info] [debug] f7359000 - f73b270c components/Pickups.so
[13/08/2013 02:33:44] [Info] [debug] f5ef2000 - f5f4d0b4 components/Actors.so
[13/08/2013 02:33:44] [Info] [debug] f5d2a000 - f5eaf7e0 components/Databases.so
[13/08/2013 02:33:44] [Info] [debug] f5cd8000 - f5d2ec48 components/Classes.so
[13/08/2013 02:33:44] [Info] [debug] f5b61000 - f5ce839d components/Console.so
[13/08/2013 02:33:44] [Info] [debug] f5b0c000 - f5b65914 components/GangZones.so
[13/08/2013 02:33:44] [Info] [debug] f5590000 - f55edddc components/TextLabels.so
[13/08/2013 02:33:44] [Info] [debug] f54f7000 - f554abdc components/Checkpoints.so
[13/08/2013 02:33:44] [Info] [debug] f548e000 - f54ffd18 components/Vehicles.so
[13/08/2013 02:33:44] [Info] [debug] f5330000 - f537eebc components/Timers.so
[13/08/2013 02:33:44] [Info] [debug] f52c5000 - f5339648 components/Objects.so
[13/08/2013 02:33:44] [Info] [debug] f523d000 - f52cd9a8 components/Unicode.so
[13/08/2013 02:33:44] [Info] [debug] f505e000 - f5248e02 /lib/i386-linux-gnu/libstdc++.so.6
[13/08/2013 02:33:44] [Info] [debug] f500e000 - f506275c components/Dialogs.so
[13/08/2013 02:33:44] [Info] [debug] f4d80000 - f5068bd4 components/sampvoice.so
[13/08/2013 02:33:44] [Info] [debug] f49c1000 - f4dc9e0d components/Pawn.so
[13/08/2013 02:33:44] [Info] [debug] f4861000 - f49ce3d1 components/LegacyConfig.so
[13/08/2013 02:33:44] [Info] [debug] f480b000 - f48652ec components/Menus.so
[13/08/2013 02:33:44] [Info] [debug] f4600000 - f482ca74 components/pawnraknet.so
[13/08/2013 02:33:44] [Info] [debug] f45a6000 - f4605318 components/TextDraws.so
[13/08/2013 02:33:44] [Info] [debug] f431f000 - f44fe009 components/CustomModels.so
[13/08/2013 02:33:44] [Info] [debug] f42d0000 - f4323408 components/Variables.so
[13/08/2013 02:33:44] [Info] [debug] f4278000 - f42d4904 components/Fixes.so
[13/08/2013 02:33:44] [Info] [debug] f3a2e000 - f3a763d4 /mnt/sdb/Server/plugins/crashdetect.so
[13/08/2013 02:33:44] [Info] [debug] f7f41000 - f7f501d4 /mnt/sdb/Server/plugins/sscanf.so
[13/08/2013 02:33:44] [Info] [debug] d7161000 - d7509ac7 /mnt/sdb/Server/plugins/mysql.so
[13/08/2013 02:33:44] [Info] [debug] da0b7000 - da0c94bc /lib/i386-linux-gnu/libnss_files.so.2
[13/08/2013 02:33:44] [Info] [debug] d62fd000 - d6401f44 /mnt/sdb/Server/plugins/streamer.so
[13/08/2013 02:33:44] [Info] [debug] f3a21000 - f3a2d011 /mnt/sdb/Server/plugins/gvar.so
[13/08/2013 02:33:44] [Info] [debug] d620a000 - d63000e3 /mnt/sdb/Server/plugins/teamspeak-connector.so
[13/08/2013 02:33:44] [Info] [debug] d5cce000 - d6230708 /mnt/sdb/Server/plugins/PawnPlus-static.so

Callback hooks don't always register properly

We spoke about this on discord a few days ago, but after experiencing the issue again I felt it would be better to bring it up as an issue here. I've noticed that callback hooks have a high chance of not working at all. It seems to happen at random and restarting the server a bunch will see a single hook working eventually, but not every hook. Hooks all work at random with varying levels of consistency and success, and a fix for this would be very appreciated!

Not sure what further information I can give, but if you need anything else like a brief code example I'll be happy to provide it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.