Server crashed on calling native CreateObject
#1

Hello!
I have created my plugin which should do create some objects onGameModeInit. So here is my code:
As I have added some debug you may see that objectId,x,y,... was successfully setted.

PHP код:
objectId atof(strtok(NULL"|"));
atof(strtok(NULL"|"));
atof(strtok(NULL"|"));
atof(strtok(NULL"|"));
rx atof(strtok(NULL"|"));
ry atof(strtok(NULL"|"));
rz atof(strtok(NULL"|"));
logprintf("CreateObject(%i,%f,%f,%f,%f,%f,%f,%f)"objectIdxyzrxryrzdest);
g_Invoke->callNative(&PAWN::CreateObjectobjectIdxyzrxryrzdest); 
I have turned up crashdetect and here is my trace:

PHP код:
[00:49:46CreateObject(5821,710.265137,-1458.937744,17.497561,0.000000,0.000000,0.000000,50.000000)
[
00:49:46] [debugServer crashed while executing AvangardRolePlay.amx
[00:49:46] [debugAMX backtrace:
[
00:49:46] [debug#0 native sampxInit () from Sampx.DLL
[00:49:46] [debug#1 00020bec in public Streamer_OnGameModeInit () from AvangardRolePlay.amx
[00:49:46] [debug#2 native CallLocalFunction () from samp-server.exe
[00:49:46] [debug#3 000020a4 in public OnGameModeInit () from AvangardRolePlay.amx
[00:49:46] [debugNative backtrace:
[
00:49:46] [debug#0 02072116 in std::list<tagAMX *,std::allocator<tagAMX *> >::empty () from plugins\Sampx.DLL
[00:49:46] [debug#1 020717c5 in Invoke::callNative () from plugins\Sampx.DLL
[00:49:46] [debug#2 02072fd4 in sampxInit () from plugins\Sampx.DLL
[00:49:46] [debug#3 004010b6 in ?? () from samp-server.exe
[00:49:46] [debug#4 0f0462ca in ?? () from plugins\crashdetect.DLL
[00:49:47] [debug#5 0f048b28 in ?? () from plugins\crashdetect.DLL
[00:49:47] [debug#6 0f0409c7 in ?? () from plugins\crashdetect.DLL
[00:49:47] [debug#7 0f04631a in ?? () from plugins\crashdetect.DLL
[00:49:47] [debug#8 0047315e in ?? () from samp-server.exe
[00:49:47] [debug#9 004010b6 in ?? () from samp-server.exe
[00:49:47] [debug#10 0f0462ca in ?? () from plugins\crashdetect.DLL
[00:49:47] [debug#11 0f048b28 in ?? () from plugins\crashdetect.DLL
[00:49:47] [debug#12 0f0409c7 in ?? () from plugins\crashdetect.DLL
[00:49:47] [debug#13 0f04631a in ?? () from plugins\crashdetect.DLL
[00:49:47] [debug#14 0046e924 in ?? () from samp-server.exe
[00:49:47] [debug#15 65646f6d in ?? () from samp-server.exe
[00:49:47] [debug#16 76412f73 in ?? () from C:\Windows\SYSTEM32\SHELL32.dll
[00:49:47] [debug#17 61676e61 in ?? () from samp-server.exe
[00:49:47] [debug#18 6f526472 in ?? () from samp-server.exe
[00:49:47] [debug#19 6c50656c in ?? () from samp-server.exe
[00:49:47] [debug#20 612e7961 in ?? () from samp-server.exe 
Could you help me with this error?
Reply
#2

I'm sorry I have forgot initialize g_Invoke

Finally:
objects are not created
No compilation errors. Server not crashed anymore

After some lurking I see that amx_map.find(native->name) == amx_map.end():

PHP код:
int Invoke::callNative(const PAWN::Native native, ...)
{
    if (
amx_list.empty() || amx_map.find(native->name) == amx_map.end())
    {
        if (
amx_map.find(native->name) == amx_map.end())
            
printf("some error map end!!!! %s. END = %i"native->nameamx_map.end());
        return 
0;
    } 
Why?

Answer:
I forgot to call g_Invoke->getAddresses();

But I still don't understand why I should do it manually. Why it's not called automaticly during constructor call?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)