[Plugin] CSTL - Data container(s) (Currently vector)
#61

can somebody include deque too?

edit:

cstl.cpp download - http://www.solidfiles.com/d/d5e9b04996/
cstl.cpp pastebin - http://pastebin.com/807FfPGT

(with cyber_punk fixes)

added:
all default vector functions for deque plus
Code:
{"deque_push_front", n_deque_push_front},
{"deque_push_front_float", n_deque_push_front_float},
{"deque_push_front_arr", n_deque_push_front_arr},
{"deque_swap", n_deque_swap},
Reply
#62

Hi, my problem to crash server linux is funkcion map_insert_arr.


Code (1 post)

Code:
//filterscript ap.p
#include <a_samp> 
#include <cstl>

new const FIRST_MAP = 0; 

public OnFilterScriptInit()
{
    map_insert_arr(FIRST_MAP, "key", "This is value");
    
    if (map_contains(FIRST_MAP, "key") == 1)
    {
        new buffer[100];
        map_get_arr(FIRST_MAP, "key", buffer, 100);
        printf("Map key \"key\" has value: %s", buffer);
    }
    printf("Map length is now: %i", map_size(FIRST_MAP));
    map_remove(FIRST_MAP, "key");
    printf("After removal size is: %i", map_size(FIRST_MAP));
    return 1;
}
Reply
#63

Hello guys, maybe someone using this plugin? I have strange problem with vector_find function
When im using this function server JUST CRASHING.

Something like

pawn Code:
vectorIndex = vector_find(playerid, itemid);
itemid - its ID from MySQL DB, in my case i want to check if vectorIndex its not -1, but this function just crashing.

EDIT: fixed.
Reply
#64

how can i load data into a vector(from player enum) with y_ini

example(this doesn't work)
Code:
public loaduser_PROPERTY(playerid ,name[] ,value[])
{
  new str[17] ,tmpValue;

  for(new i=0; i < MAX_SOMETHING ;++i) {
    format(str ,sizeof(str) ,"<%i>_Something" ,i);
    INI_Int(str ,tmpValue);
    if(tmpValue == 0) continue;
    vector_push_back(pInfo[playerid][something] ,tmpValue);
  }
  return 1;
}
Reply
#65

Hi. I have trouble with this plugin. Seems that there is problem with vector_find_arr() function.

Code:
[23:51:17] [debug] AMX backtrace:
[23:51:17] [debug] #0 native vector_find_arr () from cstl.so
[23:51:17] [debug] #1 00012444 in CallDialogResponse (playerid=0, dialogname[]=@01a0d674 "", response=1, listitem=0, inputtext[]=@01a0d6a8 "") at C:\pawno\include\dialogs.inc:70
[23:51:17] [debug] #2 00040ac4 in public NDDIALOG_GARAZ_KUPNO3 (playerid=0, response=1, listitem=-1, inputtext[]=@01ab0204 "") at C:\pawno\include\PTS/Dialogi.inc:485
[23:51:17] [debug] #3 native CallLocalFunction () from samp03svr
[23:51:17] [debug] #4 00012938 in ?? (... <5 arguments>) at C:\pawno\include\dialogs.inc:101
[23:51:17] [debug] #5 0000b810 in public OnDialogResponse (playerid=0, dialogid=17, response=1, listitem=-1, inputtext[]=@01ab0200 "") at C:\pawno\include\YSI\y_hooks/impl.inc:2254
[23:51:17] [debug] Native backtrace:
[23:51:17] [debug] #0 b74a6e8b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[23:51:17] [debug] #1 b749fbcf in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[23:51:17] [debug] #2 b74a0dbc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[23:51:17] [debug] #3 b74a1226 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[23:51:17] [debug] #4 b74a6adc in ?? () from plugins/crashdetect.so
[23:51:17] [debug] #5 b7776600 in ?? ()
[23:51:17] [debug] #6 b7542b43 in strlen () from /lib/i386-linux-gnu/libc.so.6
[23:51:17] [debug] #7 b73d8d86 in ?? () from plugins/cstl.so
[23:51:17] [debug] #8 080950e4 in ?? () from ./samp03svr
[23:51:17] [debug] #9 b74a294b in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[23:51:17] [debug] #10 b74a58f8 in ?? () from plugins/crashdetect.so
[23:51:17] [debug] #11 b74a9916 in amx_Exec () from plugins/crashdetect.so
[23:51:17] [debug] #12 b74a1be6 in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[23:51:17] [debug] #13 b74a5659 in ?? () from plugins/crashdetect.so
[23:51:17] [debug] #14 b733a27c in ?? () from plugins/streamer.so
[23:51:17] [debug] #15 b60d3620 in ?? () from plugins/YSF.so
Server crashes only when I'm using this function, for example in dialog system. I have to fix that, because this happens on my live server and players cannot play.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)