OnPlayerDeath Random Crashes.
#1

Hi there,

Basically, this seems to only happen when you kill 2 people at the same time, oddly.. It happens to the person who killed people.

I don't use 'killerid' except in a message which I know doesn't need to be checked for INVALID_KILLER_ID.

It Calls this function and I seem to crash just after it, I'm not entirely sure why.

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        RemovePlayerFromVehicle(playerid);
    }
    PlayerDead[playerid] = 1;
    DeathInt[playerid] = GetPlayerInterior(playerid);
    DeathVW[playerid] = GetPlayerVirtualWorld(playerid);
    GetPlayerPos(playerid, DeathPosX[playerid], DeathPosY[playerid], DeathPosZ[playerid]);
    CauseOfDeath[playerid] = reason;
    PlayerDeath(playerid);
   
    TextDrawHideForPlayer(playerid,speed[playerid]);
    TextDrawHideForPlayer(playerid,fuel[playerid]);
    KillTimer(SpeedoSysTimer[playerid]);
    KillTimer(BleedingTime[playerid]);
    PilotJob[playerid] = 0;
    PilotDTime[playerid] = 0;
    TruckJob[playerid] = 0;
    if(pilotveh[playerid] > 0)
    {
        SetVehicleToRespawn(pilotveh[playerid]);
        pilotveh[playerid] = 0;
    }
    BleedingTime[playerid] = -1;
    RodObject[playerid] = 0;
    HoldingRod[playerid] = 0;
    //DropGun(playerid, GetWepIndexFromSQL(GetPlayerWeaponEx(playerid)),GetPlayerAmmo(playerid),x,y,z,GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
    foreach(Player, i)
    {
        if(AdminLevel[i] > 0)
        {
            SendDeathMessageToPlayer(i, killerid, playerid, reason);
        }
    }
    //Hospitalized[playerid] = 1;
    //HospitalTime[playerid] = 30;
    //dohospital(playerid);
    if(HoldingFurni[playerid] > 0)
    {
        new id = HoldingFurni[playerid];
        HoldingFurni[playerid] = 0;
        new Float: x, Float: y, Float: z;
        GetPlayerPos(playerid, x, y, z);
        RemovePlayerAttachedObject(playerid, 6);
        FurniObject[id] = CreateDynamicObject(FurniModel[id], x, y, z,0.0,0.0,0.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), -1, 200);
        FurniX[id] = x;
        FurniY[id] = y;
        FurniZ[id] = z;
        FurniVW[id] = GetPlayerVirtualWorld(playerid);
        FurniInt[id] = GetPlayerInterior(playerid);
        SetDynamicObjectPos(FurniObject[id], FurniX[id], FurniY[id], FurniZ[id]);
        SetDynamicObjectRot(FurniObject[id], FurniXR[id], FurniYR[id], FurniZR[id]);
        new query[256];
        format(query, sizeof(query), "UPDATE `furniture` SET FurniX = %f, FurniY = %f, FurniZ = %f, FurniXR = %f, FurniYR = %f, FurniZR = %f, FurniInt = %d, FurniVW = %d WHERE id = %d LIMIT 1",FurniX[id], FurniY[id], FurniZ[id], FurniXR[id], FurniYR[id], FurniZR[id],FurniInt[id],FurniVW[id], id);
        mysql_tquery(dbHandle, query, "", "");
        HoldingFurni[playerid] = 0;
    }
    GivePlayerMoney(playerid, 100);

    return 1;
}
pawn Код:
stock PlayerDeath(playerid)
{
    printf("Called Player Death");
    PlayerIsDead[playerid] = 1;
    SetPlayerVirtualWorld(playerid, DeathVW[playerid]);
    KnockedOut[playerid] = 0;
    SetPlayerInterior(playerid, DeathInt[playerid]);
    new Float: ang;
    GetPlayerFacingAngle(playerid, ang);
    SetSpawnInfo(playerid, 0, SpawnSkin[playerid], DeathPosX[playerid], DeathPosY[playerid], DeathPosZ[playerid],ang, 0,0,0,0,0,0);
    SpawnPlayer(playerid);
    SetPlayerHealth(playerid, 99999);
    new skin = GetPlayerSkinEx(playerid);
    SetPlayerSkin(playerid, skin);
    TogglePlayerControllable(playerid, 0);
    SetPlayerPos(playerid, DeathPosX[playerid], DeathPosY[playerid], DeathPosZ[playerid]);
    SetTimerEx("DeathAnim", 350,false,"i",playerid);
    DeathTimer[playerid] = 3;
    TextDrawHideForPlayer(playerid,BFText);
    KillTimer(BleedingTime[playerid]);
   
    new model, GunAmmo, sqlid, string[128];
    format(string, sizeof(string), "You have "COL_RED"died."COL_WHITE" Please assist players with the use of "COL_GREEN"'/do' "COL_WHITE"and do not "COL_RED"RK.");
    SendClientMessage(playerid, COLOUR_WHITE, string);
    SendClientMessage(playerid, COLOUR_GREY, "Depending on your cause of death, you may be revived. You must wait 3 minutes before you can '/accept death'.");
    SendClientMessage(playerid, COLOUR_GREY, "EMT's have 4 minutes to respond before you cannot be revived.");
    TextDrawShowForPlayer(playerid, DeadDraw[playerid]);
    /*new Float: area[5];
    area[0] = 0.1;
    area[1] = 0.2;
    area[2] = 0.3;
    area[3] = 0.4;
    area[4] = 0.5;
*/

    if(Faction[playerid] != 1 && CauseOfDeath[playerid] != WEAPON_COLLISION)
    {
        for(new w = 0; w < 13; w++)
        {
            if(PlayerWeapons[playerid][w] > 0)
            {
                sqlid = PlayerWeapons[playerid][w];
                model = WepModel[sqlid];
                GunAmmo = WepAmmo[sqlid];

                DropGun(playerid, sqlid, model,GunAmmo,DeathPosX[playerid], DeathPosY[playerid], DeathPosZ[playerid] ,DeathVW[playerid],DeathInt[playerid]);
            }
        }
    }
    return 1;
}
Reply
#2

Try installing crash detect plugin and post the logs here
Reply
#3

Already did, crashdetect prints nothing, but it only seems to affect ID 2 in the game (highest ID at the time).

Basically, if you kill within an interior 2 people at the same time (custom mapped interior) it seems to crash the highest ID.
Код:
--------------------------

SA-MP Server: 0.3.7



Exception At Address: 0x042474FF Module: (Unknown)



Registers:

EAX: 0x47014CF0	EBX: 0x0018F334	ECX: 0x00000000	EDX: 0x42C80000

ESI: 0x05845A1C	EDI: 0x002D7890	EBP: 0x2277E004	ESP: 0x004974A3

EFLAGS: 0x00010206



Stack:

+0000: 0xFFFF75E8   0x59C085FF   0x44391675   0x10740824

+0010: 0x042474FF   0x005CDEE8   0x59C08500   0xC033DE75

+0020: 0x3C35FFC3   0xFF004F70   0xE8082474   0xFFFFFFC5

+0030: 0x6AC35959   0x64F8680C   0x02E8004B   0x8B000044

+0040: 0xF6850875   0x3D835874   0x004F75D4   0x6A407503

+0050: 0x43B9E804   0x83590000   0x5600FC65   0x0051BBE8

+0060: 0x45895900   0x74C085E4   0xE8505609   0x000051D7

+0070: 0x4D835959   0x0BE8FFFC   0x83000000   0x7500E47D

+0080: 0x0875FF1D   0x046A0AEB   0x0042CDE8   0x56C35900

+0090: 0x35FF006A   0x004F75D0   0xA1A415FF   0xD9E8004A

+00A0: 0xC3000043   0x51EC8B55   0xF8458D51   0xC415FF50

+00B0: 0x8B004AA0   0x4D8BF845   0x05006AFC   0x2AC18000

+00C0: 0x98968068   0x21D18100   0x51FE624E   0x5C4BE850

+00D0: 0x4D8B0000   0x74C98508   0xC9018902   0xEC8B55C3

+00E0: 0x5620EC83   0x5708758B   0x5010458D   0x8D0C75FF

+00F0: 0xC750E045   0xFFFFE445   0x45C77FFF   0x000042EC

+0100: 0xE8758900   0xE8E07589   0x00004863   0x850CC483

+0110: 0x74F88BF6   0xE44DFF1A   0x458B0878   0x0000C6E0

+0120: 0x458D0DEB   0x006A50E0   0x005C58E8   0x8B595900

+0130: 0xC95E5FC7   0xE85756C3   0x00005FDE   0x3B64788B



--------------------------



Loaded Modules:

samp-server.exe	A: 0x00400000 - 0x004FA000	(C:\Users\Grant\Dropbox\Bone County Roleplay\samp-server.exe)

ntdll.dll	A: 0x77690000 - 0x77810000	(C:\Windows\SysWOW64\ntdll.dll)

kernel32.dll	A: 0x75050000 - 0x75160000	(C:\Windows\syswow64\kernel32.dll)

KERNELBASE.dll	A: 0x75AC0000 - 0x75B07000	(C:\Windows\syswow64\KERNELBASE.dll)

SHELL32.dll	A: 0x75C90000 - 0x768DC000	(C:\Windows\syswow64\SHELL32.dll)

msvcrt.dll	A: 0x771E0000 - 0x7728C000	(C:\Windows\syswow64\msvcrt.dll)

SHLWAPI.dll	A: 0x76C90000 - 0x76CE7000	(C:\Windows\syswow64\SHLWAPI.dll)

GDI32.dll	A: 0x756C0000 - 0x75750000	(C:\Windows\syswow64\GDI32.dll)

USER32.dll	A: 0x75780000 - 0x75880000	(C:\Windows\syswow64\USER32.dll)

ADVAPI32.dll	A: 0x75B70000 - 0x75C11000	(C:\Windows\syswow64\ADVAPI32.dll)

sechost.dll	A: 0x75C20000 - 0x75C39000	(C:\Windows\SysWOW64\sechost.dll)

RPCRT4.dll	A: 0x75910000 - 0x75A00000	(C:\Windows\syswow64\RPCRT4.dll)

SspiCli.dll	A: 0x74FF0000 - 0x75050000	(C:\Windows\syswow64\SspiCli.dll)

CRYPTBASE.dll	A: 0x74FE0000 - 0x74FEC000	(C:\Windows\syswow64\CRYPTBASE.dll)

LPK.dll	A: 0x77660000 - 0x7766A000	(C:\Windows\syswow64\LPK.dll)

USP10.dll	A: 0x75A10000 - 0x75AAD000	(C:\Windows\syswow64\USP10.dll)

WSOCK32.dll	A: 0x736D0000 - 0x736D7000	(C:\Windows\system32\WSOCK32.dll)

WS2_32.dll	A: 0x75880000 - 0x758B5000	(C:\Windows\syswow64\WS2_32.dll)

NSI.dll	A: 0x75A00000 - 0x75A06000	(C:\Windows\syswow64\NSI.dll)

WINMM.dll	A: 0x70B70000 - 0x70BA2000	(C:\Windows\system32\WINMM.dll)

IMM32.DLL	A: 0x76960000 - 0x769C0000	(C:\Windows\system32\IMM32.DLL)

MSCTF.dll	A: 0x76E40000 - 0x76F0D000	(C:\Windows\syswow64\MSCTF.dll)

dbghelp.dll	A: 0x730B0000 - 0x7319B000	(C:\Windows\system32\dbghelp.dll)

MSVCP100.dll	A: 0x01D80000 - 0x01DE9000	(C:\Windows\system32\MSVCP100.dll)

MSVCR100.dll	A: 0x784B0000 - 0x7856F000	(C:\Windows\system32\MSVCR100.dll)

mysql.DLL	A: 0x0F810000 - 0x0F84E000	(C:\Users\Grant\Dropbox\Bone County Roleplay\plugins\mysql.DLL)

libmysql.dll	A: 0x0FE80000 - 0x1038C000	(C:\Users\Grant\Dropbox\Bone County Roleplay\libmysql.dll)

Secur32.dll	A: 0x70F00000 - 0x70F08000	(C:\Windows\system32\Secur32.dll)

MSVCR120.dll	A: 0x0F480000 - 0x0F56E000	(C:\Windows\system32\MSVCR120.dll)

MSVCP120.dll	A: 0x026E0000 - 0x02751000	(C:\Windows\system32\MSVCP120.dll)

NLAapi.dll	A: 0x70EE0000 - 0x70EF0000	(C:\Windows\system32\NLAapi.dll)

napinsp.dll	A: 0x70ED0000 - 0x70EE0000	(C:\Windows\system32\napinsp.dll)

pnrpnsp.dll	A: 0x70EB0000 - 0x70EC2000	(C:\Windows\system32\pnrpnsp.dll)

mswsock.dll	A: 0x71690000 - 0x716CC000	(C:\Windows\System32\mswsock.dll)

DNSAPI.dll	A: 0x734A0000 - 0x734E4000	(C:\Windows\system32\DNSAPI.dll)

winrnr.dll	A: 0x70EA0000 - 0x70EA8000	(C:\Windows\System32\winrnr.dll)

rasadhlp.dll	A: 0x6B4B0000 - 0x6B4B6000	(C:\Windows\system32\rasadhlp.dll)

streamer.DLL	A: 0x0F380000 - 0x0F3CC000	(C:\Users\Grant\Dropbox\Bone County Roleplay\plugins\streamer.DLL)

MSVCP140.dll	A: 0x71DD0000 - 0x71E3D000	(C:\Windows\system32\MSVCP140.dll)

VCRUNTIME140.dll	A: 0x71DB0000 - 0x71DC5000	(C:\Windows\system32\VCRUNTIME140.dll)

api-ms-win-crt-runtime-l1-1-0.dll	A: 0x71D70000 - 0x71D74000	(C:\Windows\system32\api-ms-win-crt-runtime-l1-1-0.dll)

ucrtbase.DLL	A: 0x5B8F0000 - 0x5B9D1000	(C:\Windows\system32\ucrtbase.DLL)

api-ms-win-core-timezone-l1-1-0.dll	A: 0x71D60000 - 0x71D63000	(C:\Windows\system32\api-ms-win-core-timezone-l1-1-0.dll)

api-ms-win-core-file-l2-1-0.dll	A: 0x71D50000 - 0x71D53000	(C:\Windows\system32\api-ms-win-core-file-l2-1-0.dll)

api-ms-win-core-localization-l1-2-0.dll	A: 0x71D20000 - 0x71D23000	(C:\Windows\system32\api-ms-win-core-localization-l1-2-0.dll)

api-ms-win-core-synch-l1-2-0.dll	A: 0x71EE0000 - 0x71EE3000	(C:\Windows\system32\api-ms-win-core-synch-l1-2-0.dll)

api-ms-win-core-processthreads-l1-1-1.dll	A: 0x71D30000 - 0x71D33000	(C:\Windows\system32\api-ms-win-core-processthreads-l1-1-1.dll)

api-ms-win-core-file-l1-2-0.dll	A: 0x71D10000 - 0x71D13000	(C:\Windows\system32\api-ms-win-core-file-l1-2-0.dll)

api-ms-win-crt-string-l1-1-0.dll	A: 0x5C710000 - 0x5C714000	(C:\Windows\system32\api-ms-win-crt-string-l1-1-0.dll)

api-ms-win-crt-heap-l1-1-0.dll	A: 0x5C700000 - 0x5C703000	(C:\Windows\system32\api-ms-win-crt-heap-l1-1-0.dll)

api-ms-win-crt-stdio-l1-1-0.dll	A: 0x5C6F0000 - 0x5C6F4000	(C:\Windows\system32\api-ms-win-crt-stdio-l1-1-0.dll)

api-ms-win-crt-convert-l1-1-0.dll	A: 0x5B810000 - 0x5B814000	(C:\Windows\system32\api-ms-win-crt-convert-l1-1-0.dll)

api-ms-win-crt-locale-l1-1-0.dll	A: 0x5B800000 - 0x5B803000	(C:\Windows\system32\api-ms-win-crt-locale-l1-1-0.dll)

api-ms-win-crt-math-l1-1-0.dll	A: 0x5B630000 - 0x5B635000	(C:\Windows\system32\api-ms-win-crt-math-l1-1-0.dll)

api-ms-win-crt-multibyte-l1-1-0.dll	A: 0x72020000 - 0x72025000	(C:\Windows\system32\api-ms-win-crt-multibyte-l1-1-0.dll)

api-ms-win-crt-time-l1-1-0.dll	A: 0x71F80000 - 0x71F83000	(C:\Windows\system32\api-ms-win-crt-time-l1-1-0.dll)

api-ms-win-crt-filesystem-l1-1-0.dll	A: 0x71F70000 - 0x71F73000	(C:\Windows\system32\api-ms-win-crt-filesystem-l1-1-0.dll)

api-ms-win-crt-environment-l1-1-0.dll	A: 0x71F60000 - 0x71F63000	(C:\Windows\system32\api-ms-win-crt-environment-l1-1-0.dll)

api-ms-win-crt-utility-l1-1-0.dll	A: 0x71F50000 - 0x71F53000	(C:\Windows\system32\api-ms-win-crt-utility-l1-1-0.dll)

sscanf.DLL	A: 0x01E40000 - 0x01E4D000	(C:\Users\Grant\Dropbox\Bone County Roleplay\plugins\sscanf.DLL)

Whirlpool.DLL	A: 0x02760000 - 0x0276C000	(C:\Users\Grant\Dropbox\Bone County Roleplay\plugins\Whirlpool.DLL)

MSVCR80.dll	A: 0x77B30000 - 0x77BCB000	(C:\Windows\WinSxS\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4940_none_d08cc06a442b34fc\MSVCR80.dll)

wshtcpip.dll	A: 0x70BF0000 - 0x70BF5000	(C:\Windows\System32\wshtcpip.dll)

IPHLPAPI.DLL	A: 0x731E0000 - 0x731FC000	(C:\Windows\system32\IPHLPAPI.DLL)

WINNSI.DLL	A: 0x731D0000 - 0x731D7000	(C:\Windows\system32\WINNSI.DLL)
Reply
#4

Are you sure you don't have any invalid object IDs? There is an issue where some objects can create opcodes when they stream OUT for a player. So my guess is, there is an object in there somewhere that when streamed out will cause opcodes and multiple opcodes will result in a crash.
Reply
#5

How would I go around checking which one is causing issues? There are no opcodes that I can see, or players have experienced. I read about SetPlayerSkin causing crashing if it is applied under OnPlayerDeath, which I did, so I've removed that and just need to test now.
Reply
#6

I assume that u use it to set the skin for like rp situation of being dead or something i dob't ..Well i'd suggest that if u have to use setplayerskin under on playerdeath you should use a timer.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)